Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ItemContract

DataContract System.Runtime.Serialization.CollectionDataContract.CollectionDataContractCriticalHelper.ItemContract
getsetpackage

Definition at line 110 of file CollectionDataContract.cs.

111 {
112 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
113 get
114 {
115 if (_itemContract == null)
116 {
117 if (IsDictionary)
118 {
119 if (string.CompareOrdinal(KeyName, ValueName) == 0)
120 {
121 DataContract.ThrowInvalidDataContractException(System.SR.Format(System.SR.DupKeyValueName, DataContract.GetClrTypeFullName(base.UnderlyingType), KeyName), base.UnderlyingType);
122 }
123 _itemContract = ClassDataContract.CreateClassDataContractForKeyValue(ItemType, base.Namespace, new string[2] { KeyName, ValueName });
125 }
126 else
127 {
129 if (_itemContract == null)
130 {
132 }
133 }
134 }
135 return _itemContract;
136 }
137 set
138 {
140 }
141 }
DataContract(DataContractCriticalHelper helper)
static DataContract GetDataContract(Type type)
static DataContract GetDataContractFromGeneratedAssembly(Type type)
static string DupKeyValueName
Definition SR.cs:74
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

Referenced by System.Runtime.Serialization.CollectionDataContract.InitCollectionDataContract().