Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataContractSurrogateCaller.cs
Go to the documentation of this file.
2
4
5internal static class DataContractSurrogateCaller
6{
7 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
9 {
11 {
12 return type;
13 }
14 return surrogateProvider.GetSurrogateType(type) ?? type;
15 }
16
17 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
18 [return: NotNullIfNotNull("obj")]
20 {
21 if (obj == null)
22 {
23 return null;
24 }
26 {
27 return obj;
28 }
29 return surrogateProvider.GetObjectToSerialize(obj, membertype);
30 }
31
32 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
33 [return: NotNullIfNotNull("obj")]
35 {
36 if (obj == null)
37 {
38 return null;
39 }
41 {
42 return obj;
43 }
44 return surrogateProvider.GetDeserializedObject(obj, memberType);
45 }
46}
static Type GetDataContractType(ISerializationSurrogateProvider surrogateProvider, Type type)
static object GetObjectToSerialize(ISerializationSurrogateProvider surrogateProvider, object obj, Type objType, Type membertype)
static object GetDeserializedObject(ISerializationSurrogateProvider surrogateProvider, object obj, Type objType, Type memberType)
static DataContract GetBuiltInDataContract(Type type)