Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
KnownTypeDataContractResolver.cs
Go to the documentation of this file.
2using System.Xml;
3
5
7{
9
11 {
12 _context = context;
13 }
14
15 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
17 {
18 if (type == null)
19 {
20 typeName = null;
21 typeNamespace = null;
22 return false;
23 }
25 {
26 typeName = null;
27 typeNamespace = null;
28 return true;
29 }
32 {
33 typeName = dataContract.Name;
34 typeNamespace = dataContract.Namespace;
35 return true;
36 }
37 typeName = null;
38 typeNamespace = null;
39 return false;
40 }
41
42 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
44 {
45 if (typeName == null || typeNamespace == null)
46 {
47 return null;
48 }
50 }
51}
static DataContract GetDataContract(Type type)
override bool TryResolveType(Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace)
override Type ResolveName(string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
bool IsKnownType(DataContract dataContract, Dictionary< XmlQualifiedName, DataContract > knownDataContracts, Type declaredType)