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

◆ XmlFormatGetOnlyCollectionReaderDelegate

XmlFormatGetOnlyCollectionReaderDelegate System.Runtime.Serialization.CollectionDataContract.XmlFormatGetOnlyCollectionReaderDelegate
getsetpackage

Definition at line 877 of file CollectionDataContract.cs.

878 {
879 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
880 get
881 {
883 {
884 lock (this)
885 {
887 {
888 if (base.UnderlyingType.IsInterface && (Kind == CollectionKind.Enumerable || Kind == CollectionKind.Collection || Kind == CollectionKind.GenericEnumerable))
889 {
890 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(System.SR.Format(System.SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(base.UnderlyingType))));
891 }
893 {
894 DataContract.ThrowInvalidDataContractException(_helper.DeserializationExceptionMessage, null);
895 }
896 if (Kind != CollectionKind.Array && AddMethod == null)
897 {
898 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(System.SR.Format(System.SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(base.UnderlyingType))));
899 }
903 }
904 }
905 }
907 }
908 set
909 {
910 }
911 }
XmlFormatGetOnlyCollectionReaderDelegate CreateXmlFormatGetOnlyCollectionReaderDelegate()
DataContract(DataContractCriticalHelper helper)
static string GetOnlyCollectionMustHaveAddMethod
Definition SR.cs:532
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

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