8 types derived from DataContract
System.Runtime.Serialization (8)
System\Runtime\Serialization\ClassDataContract.cs (1)
18internal sealed class ClassDataContract : DataContract
System\Runtime\Serialization\CollectionDataContract.cs (1)
68internal sealed class CollectionDataContract : DataContract
System\Runtime\Serialization\EnumDataContract.cs (1)
20internal sealed class EnumDataContract : DataContract
System\Runtime\Serialization\GenericParameterDataContract.cs (1)
10sealed class GenericParameterDataContract : DataContract
System\Runtime\Serialization\PrimitiveDataContract.cs (1)
17internal abstract class PrimitiveDataContract : DataContract
System\Runtime\Serialization\SpecialTypeDataContract.cs (1)
13sealed class SpecialTypeDataContract : DataContract
System\Runtime\Serialization\SurrogateDataContract.cs (1)
14internal sealed class SurrogateDataContract : DataContract
System\Runtime\Serialization\XmlDataContract.cs (1)
21internal sealed class XmlDataContract : DataContract
795 references to DataContract
System.Runtime.Serialization (795)
System\Runtime\Serialization\ClassDataContract.cs (70)
13using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 329DataContract.ThrowInvalidDataContractException( 333DataContract.GetClrTypeFullName(declaringType), 341internal static XmlDictionaryString GetChildNamespaceToDeclare(DataContract dataContract, Type childType, XmlDictionary dictionary) 343childType = DataContract.UnwrapNullableType(childType); 345&& DataContract.GetBuiltInDataContract(childType) == null && childType != Globals.TypeOfDBNull) 347string ns = DataContract.GetStableName(childType).Namespace; 466DataContract.GetClrTypeFullName(UnderlyingType)), 482DataContract.GetClrTypeFullName(UnderlyingType)), 496DataContract.GetClrTypeFullName(UnderlyingType)), 510DataContract.GetClrTypeFullName(UnderlyingType), 524DataContract.GetClrTypeFullName(UnderlyingType), 544DataContract.GetClrTypeFullName(UnderlyingType), 553DataContract.GetClrTypeFullName(UnderlyingType), 580DataContract.GetClrTypeFullName(UnderlyingType)), 596DataContract.GetClrTypeFullName(this.UnderlyingType), 610DataContract.GetClrTypeFullName(UnderlyingType), 630DataContract.GetClrTypeFullName(UnderlyingType), 639DataContract.GetClrTypeFullName(UnderlyingType), 655class ClassDataContractCriticalHelper : DataContract.DataContractCriticalHelper 709throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.ISerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)))); 716DataContract baseContract = DataContract.GetDataContract(baseType); 725DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(baseType)))); 732throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.OnlyDataContractTypesCanHaveExtensionData, DataContract.GetClrTypeFullName(type)))); 810DataContract.ThrowInvalidDataContractException( 812DataContract.GetClrTypeFullName(type), 814DataContract.GetClrTypeFullName(this.BaseContract.UnderlyingType), 836DataContract.ThrowInvalidDataContractException( 838DataContract.GetClrTypeFullName(type), 874ThrowInvalidDataContractException(SR.GetString(SR.TooManyDataMembers, DataContract.GetClrTypeFullName(member.DeclaringType), member.Name)); 901ThrowInvalidDataContractException(SR.GetString(SR.InvalidMember, DataContract.GetClrTypeFullName(type), member.Name)); 907ThrowInvalidDataContractException(SR.GetString(SR.InvalidDataMemberName, member.Name, DataContract.GetClrTypeFullName(type))); 913memberContract.Name = DataContract.EncodeLocalName(memberContract.Name); 914memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 920DataContract.GetClrTypeFullName(member.DeclaringType), 939ThrowInvalidDataContractException(SR.GetString(SR.TooManyIgnoreDataMemberAttributes, DataContract.GetClrTypeFullName(member.DeclaringType), member.Name)); 969memberContract.Name = DataContract.EncodeLocalName(member.Name); 970memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 980memberContract.Name = DataContract.EncodeLocalName(member.Name); 988DataContract.GetClrTypeFullName(member.DeclaringType), 993memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 1084return DataContract.GetStableName(type, out this.hasDataContract); 1144ThrowInvalidDataContractException(SR.GetString(SR.DuplicateExtensionDataSetMethod, method, extensionDataSetMethod, DataContract.GetClrTypeFullName(method.DeclaringType))); 1146DataContract.ThrowInvalidDataContractException(SR.GetString(SR.ExtensionDataSetMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1148DataContract.ThrowInvalidDataContractException(SR.GetString(SR.ExtensionDataSetParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method, Globals.TypeOfExtensionDataObject), method.DeclaringType); 1159DataContract.ThrowInvalidDataContractException(SR.GetString(SR.DuplicateCallback, method, currentCallback, DataContract.GetClrTypeFullName(method.DeclaringType), attributeType), method.DeclaringType); 1161DataContract.ThrowInvalidDataContractException(SR.GetString(SR.DuplicateAttribute, prevAttributeType, attributeType, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1163DataContract.ThrowInvalidDataContractException(SR.GetString(SR.CallbacksCannotBeVirtualMethods, method, DataContract.GetClrTypeFullName(method.DeclaringType), attributeType), method.DeclaringType); 1167DataContract.ThrowInvalidDataContractException(SR.GetString(SR.CallbackMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1169DataContract.ThrowInvalidDataContractException(SR.GetString(SR.CallbackParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method, Globals.TypeOfStreamingContext), method.DeclaringType); 1250knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 1309throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.SerializationInfo_ConstructorNotFound, DataContract.GetClrTypeFullName(UnderlyingType)))); 1326throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.NonAttributedSerializableTypesMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type)))); 1396internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts) 1404DataContract boundContract; 1420stableName = DataContract.GetStableName(type.GetGenericTypeDefinition()); 1432boundClassContract.StableName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(stableName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(this.UnderlyingType), genericParams)), stableName.Namespace);
System\Runtime\Serialization\CodeExporter.cs (71)
19using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 56foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet) 58DataContract dataContract = pair.Value; 230bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 267foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet) 269DataContract dataContract = pair.Value; 291throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(dataContract.GetType()), DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 353internal CodeTypeReference GetCodeTypeReference(DataContract dataContract) 369internal CodeTypeReference GetElementTypeReference(DataContract dataContract, bool isElementTypeNullable) 379get { return DataContract.GetStableName(Globals.TypeOfListGeneric); } 389get { return DataContract.GetStableName(Globals.TypeOfDictionaryGeneric); } 397ContractCodeDomInfo GetContractCodeDomInfo(DataContract dataContract) 408void GenerateType(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 467CodeTypeDeclaration GetNestedType(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 476DataContract containingDataContract = dataContractSet[new XmlQualifiedName(containingTypeName, dataContract.StableName.Namespace)]; 512static CodeTypeDeclaration CreateTypeDeclaration(string typeName, DataContract dataContract) 536CodeTypeReference GetReferencedType(DataContract dataContract) 563throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.TypeMustBeIXmlSerializable, DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(Globals.TypeOfIXmlSerializable), dataContract.StableName.Name, dataContract.StableName.Namespace))); 565DataContract referencedContract = dataContractSet.GetDataContract(type); 576DataContract referencedContract; 606DataContract itemContract = collectionContract.ItemContract; 622DataContract itemContract = collectionContract.ItemContract; 660bool TryGetReferencedListType(DataContract itemContract, bool isItemTypeNullable, out CodeTypeReference typeReference) 673CodeTypeReference GetSurrogatedTypeReference(DataContract dataContract) 693CodeTypeReference GetReferencedGenericType(GenericInfo genInfo, out DataContract dataContract) 718DataContract[] paramContracts = new DataContract[genInfo.Parameters.Count]; 723DataContract paramContract = dataContractSet[stableName]; 748dataContract = DataContract.GetDataContract(type).BindGenericParameters(paramContracts, new Dictionary<DataContract, DataContract>()); 794string reencodedName = DataContract.EncodeLocalName(decodedName); 822CodeAttributeDeclaration dataContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfDataContractAttribute)); 887CodeAttributeDeclaration dataMemberAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfDataMemberAttribute)); 900CodeAttributeDeclaration optionalFieldAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfOptionalFieldAttribute)); 917return (DataContract.GetDefaultStableNamespace(clrNamespace) != dataContractNamespace); 920internal ICollection<CodeTypeReference> GetKnownTypeReferences(DataContract dataContract) 926ICollection<DataContract> knownTypeContracts = knownTypeDictionary.Values; 931foreach (DataContract knownTypeContract in knownTypeContracts) 938DataContractDictionary GetKnownTypeContracts(DataContract dataContract) 950return GetKnownTypeContracts((ClassDataContract)dataContract, new Dictionary<DataContract, object>()); 955DataContractDictionary GetKnownTypeContracts(ClassDataContract dataContract, Dictionary<DataContract, object> handledContracts) 966DataContract memberContract = dataMember.MemberTypeContract; 999foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in knownContracts) 1008DataContractDictionary knownContractDictionary = GetKnownTypeContracts(dataContract, new Dictionary<DataContract, object>()); 1012ICollection<DataContract> knownTypeContracts = knownContractDictionary.Values; 1013foreach (DataContract knownTypeContract in knownTypeContracts) 1015CodeAttributeDeclaration knownTypeAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfKnownTypeAttribute)); 1037type.BaseTypes.Add(DataContract.GetClrTypeFullName(Globals.TypeOfIExtensibleDataObject)); 1041CodeAttributeDeclaration nonSerializedAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfNonSerializedAttribute)); 1069void ThrowIfReferencedBaseTypeSealed(Type baseType, DataContract dataContract) 1072throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.CannotDeriveFromSealedReferenceType, dataContract.StableName.Name, dataContract.StableName.Namespace, DataContract.GetClrTypeFullName(baseType)))); 1086type.CustomAttributes.Add(new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfFlagsAttribute))); 1091CodeAttributeDeclaration dataContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfDataContractAttribute)); 1110CodeAttributeDeclaration enumMemberAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfEnumMemberAttribute)); 1125if (DataContract.GetDefaultStableNamespace(contractCodeDomInfo.ClrNamespace) != dataContract.StableName.Namespace) 1126throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidClrNamespaceGeneratedForISerializable, dataContract.StableName.Name, dataContract.StableName.Namespace, DataContract.GetDataContractNamespaceFromUri(dataContract.StableName.Namespace), contractCodeDomInfo.ClrNamespace))); 1149type.BaseTypes.Add(DataContract.GetClrTypeFullName(Globals.TypeOfISerializable)); 1201DataContract itemContract = collectionContract.ItemContract; 1222string expectedTypeNs = DataContract.GetCollectionNamespace(itemContract.StableName.Namespace); 1225expectedTypeName, expectedTypeNs, DataContract.GetClrTypeFullName(Globals.TypeOfIListGeneric), DataContract.GetClrTypeFullName(Globals.TypeOfICollectionGeneric)))); 1232CodeAttributeDeclaration collectionContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfCollectionDataContractAttribute)); 1266type.BaseTypes.Add(DataContract.GetClrTypeFullName(Globals.TypeOfIXmlSerializable)); 1276DataContract.GetClrTypeFullName(Globals.TypeOfXmlSchemaProviderAttribute), 1284DataContract.GetClrTypeFullName(Globals.TypeOfXmlSchemaProviderAttribute), 1303CodeAttributeDeclaration xmlRootAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfXmlRootAttribute)); 1344CodeAttributeDeclaration namespaceAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfContractNamespaceAttribute)); 1428string GetClrNamespace(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo)
System\Runtime\Serialization\CodeGenerator.cs (9)
883throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.CanOnlyStoreIntoArgOrLocGot0, DataContract.GetClrTypeFullName(var.GetType())))); 1099throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.UnknownConstantType, DataContract.GetClrTypeFullName(valueType)))); 1415throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ArrayTypeIsNotSupported, DataContract.GetClrTypeFullName(arrayElementType)))); 1478throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ArrayTypeIsNotSupported, DataContract.GetClrTypeFullName(arrayElementType)))); 1654throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.NoConversionPossibleTo, DataContract.GetClrTypeFullName(target)))); 1669throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source)))); 1690throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source))));
System\Runtime\Serialization\CollectionDataContract.cs (66)
16using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 84DataContract itemContract; 112internal CollectionDataContract(Type type, DataContract itemContract) 157void InitCollectionDataContract(DataContract sharedTypeContract) 196public DataContract ItemContract 212internal DataContract SharedTypeContract 458throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(this.UnderlyingType)))); 477class CollectionDataContractCriticalHelper : DataContract.DataContractCriticalHelper 487DataContract itemContract; 488DataContract sharedTypeContract; 532this.isItemTypeNullable = DataContract.IsTypeNullable(itemType); 541throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType)))); 542itemName = DataContract.EncodeLocalName(collectionContractAttribute.ItemName); 548throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType)))); 550throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName))); 551keyName = DataContract.EncodeLocalName(collectionContractAttribute.KeyName); 556throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType)))); 558throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName))); 559valueName = DataContract.EncodeLocalName(collectionContractAttribute.ValueName); 566this.itemName = itemName ?? DataContract.GetStableName(DataContract.UnwrapNullableType(itemType)).Name; 594this.StableName = DataContract.GetStableName(type); 599internal CollectionDataContractCriticalHelper(Type type, DataContract itemContract) 614throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.CollectionMustHaveGetEnumeratorMethod, DataContract.GetClrTypeFullName(type)))); 616throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.CollectionMustHaveItemType, DataContract.GetClrTypeFullName(type)))); 619this.StableName = DataContract.GetCollectionStableName(type, itemType, out collectionContractAttribute); 632throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(type)))); 661internal DataContract ItemContract 671DataContract.ThrowInvalidDataContractException( 672SR.GetString(SR.DupKeyValueName, DataContract.GetClrTypeFullName(UnderlyingType), KeyName), 677DataContract.GetDataContract(ItemType); 681itemContract = DataContract.GetDataContract(ItemType); 692internal DataContract SharedTypeContract 779knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 819DataContract GetSharedTypeContract(Type type) 860if (type.IsArray && DataContract.GetBuiltInDataContract(type) == null) 865DataContract dataContract; 869internal static bool TryCreate(Type type, out DataContract dataContract) 875internal static bool TryCreateGetOnlyCollectionDataContract(Type type, out DataContract dataContract) 906static bool IsCollectionOrTryCreate(Type type, bool tryCreate, out DataContract dataContract, out Type itemType, bool constructorRequired, bool skipIfReadOnlyContract = false) 911if (DataContract.GetBuiltInDataContract(type) != null) 1064SR.CollectionTypeDoesNotHaveAddMethod, DataContract.GetClrTypeFullName(itemType), ref dataContract); 1069GetReadOnlyCollectionExceptionMessages(type, hasCollectionDataContract, SR.CollectionTypeDoesNotHaveAddMethod, DataContract.GetClrTypeFullName(itemType), out serializationExceptionMessage, out deserializationExceptionMessage); 1130static bool HandleIfInvalidCollection(Type type, bool tryCreate, bool hasCollectionDataContract, bool createContractWithException, string message, string param, ref DataContract dataContract) 1135throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(GetInvalidCollectionMessage(message, SR.GetString(SR.InvalidCollectionDataContract, DataContract.GetClrTypeFullName(type)), param))); 1142dataContract = new CollectionDataContract(type, GetInvalidCollectionMessage(message, SR.GetString(SR.InvalidCollectionType, DataContract.GetClrTypeFullName(type)), param)); 1151serializationExceptionMessage = GetInvalidCollectionMessage(message, SR.GetString(hasCollectionDataContract ? SR.InvalidCollectionDataContract : SR.InvalidCollectionType, DataContract.GetClrTypeFullName(type)), param); 1152deserializationExceptionMessage = GetInvalidCollectionMessage(message, SR.GetString(SR.ReadOnlyCollectionDeserialization, DataContract.GetClrTypeFullName(type)), param); 1234internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts) 1236DataContract boundContract; 1247boundCollectionContract.StableName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(this.StableName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(this.UnderlyingType), paramContracts)), 1248IsCollectionDataContract(UnderlyingType) ? this.StableName.Namespace : DataContract.GetCollectionNamespace(boundCollectionContract.ItemContract.StableName.Namespace)); 1252internal override DataContract GetValidContract(SerializationMode mode) 1257DataContract.ThrowTypeNotSerializable(UnderlyingType); 1271internal override DataContract GetValidContract() 1287throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(this.UnderlyingType)))); 1315DataContract.GetClrTypeFullName(UnderlyingType)), 1327DataContract.GetClrTypeFullName(ItemType)), 1339DataContract.GetClrTypeFullName(UnderlyingType)), 1351DataContract.GetClrTypeFullName(UnderlyingType), 1374DataContract.GetClrTypeFullName(UnderlyingType)), 1386DataContract.GetClrTypeFullName(ItemType)),
System\Runtime\Serialization\DataContract.cs (106)
20using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 52internal static DataContract GetDataContract(Type type) 57internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 63internal static DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle, SerializationMode mode) 65DataContract dataContract = GetDataContractSkipValidation(id, typeHandle, null); 74internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 79internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 81DataContract dataContract = GetGetOnlyCollectionDataContractSkipValidation(id, typeHandle, type); 85throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(SR.GetString(SR.ClassDataContractReturnedForGetOnlyCollection, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 93internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 101internal static DataContract GetDataContractForInitialization(int id) 125public static DataContract GetBuiltInDataContract(Type type) 133public static DataContract GetBuiltInDataContract(string name, string ns) 141public static DataContract GetBuiltInDataContract(string typeName) 218throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 223throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 361internal virtual DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts) 366internal virtual DataContract GetValidContract(SerializationMode mode) 371internal virtual DataContract GetValidContract() 399static DataContract[] dataContractCache; 401static Dictionary<Type, DataContract> typeToBuiltInContract; 402static Dictionary<XmlQualifiedName, DataContract> nameToBuiltInContract; 403static Dictionary<string, DataContract> typeNameToBuiltInContract; 436dataContractCache = new DataContract[32]; 440internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 442DataContract dataContract = dataContractCache[id]; 454internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 456DataContract dataContract = dataContractCache[id]; 466internal static DataContract GetDataContractForInitialization(int id) 468DataContract dataContract = dataContractCache[id]; 478int id = DataContract.GetId(classContract.TypeForInitialization.TypeHandle); 496static bool ContractMatches(DataContract contract, DataContract cachedContract) 554Array.Resize<DataContract>(ref dataContractCache, newSize); 560static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 562DataContract dataContract = dataContractCache[id]; 617static void AssignDataContractToId(DataContract dataContract, int id) 625static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 627DataContract dataContract = null; 680public static DataContract GetBuiltInDataContract(Type type) 688typeToBuiltInContract = new Dictionary<Type, DataContract>(); 690DataContract dataContract = null; 700public static DataContract GetBuiltInDataContract(string name, string ns) 705nameToBuiltInContract = new Dictionary<XmlQualifiedName, DataContract>(); 707DataContract dataContract = null; 720public static DataContract GetBuiltInDataContract(string typeName) 728typeNameToBuiltInContract = new Dictionary<string, DataContract>(); 730DataContract dataContract = null; 797static public bool TryCreateBuiltInDataContract(Type type, out DataContract dataContract) 878static public bool TryCreateBuiltInDataContract(string name, string ns, out DataContract dataContract) 1299return (DataContract.GetBuiltInDataContract(type) != null || ClassDataContract.IsNonAttributedTypeValidForSerialization(type)); 1326throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.RecursiveCollectionType, DataContract.GetClrTypeFullName(itemType)))); 1457throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidDataContractName, DataContract.GetClrTypeFullName(type)))); 1460name = DataContract.EncodeLocalName(name); 1469throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidDataContractNamespace, DataContract.GetClrTypeFullName(type)))); 1507DataContract builtInContract = GetBuiltInDataContract(type); 1570throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractName, DataContract.GetClrTypeFullName(type)))); 1573name = DataContract.EncodeLocalName(name); 1582throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractNamespace, DataContract.GetClrTypeFullName(type)))); 1605if (DataContract.GetBuiltInDataContract(itemType) != null) 1618GenericInfo genericInfo = new GenericInfo(DataContract.GetStableName(Globals.TypeOfNullable), Globals.TypeOfNullable.FullName); 1655typeName = DataContract.GetClrTypeFullName(type).Substring(nsLen).Replace('+', '.'); 1677XmlQualifiedName qname = DataContract.GetStableName(genParam); 1694return DataContract.EncodeLocalName(typeName); 1830return DataContract.GetClrTypeFullName(type); 1875DataContract dataContract = GetBuiltInDataContract(fullTypeName); 1906localName = DataContract.EncodeLocalName(localName); 2061while (type != null && DataContract.IsTypeSerializable(type)) 2079DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeOneScheme, DataContract.GetClrTypeFullName(type)), type); 2089DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeOneScheme, DataContract.GetClrTypeFullName(type)), type); 2095DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeNoData, DataContract.GetClrTypeFullName(type)), type); 2099DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeEmptyString, DataContract.GetClrTypeFullName(type)), type); 2103DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeUnknownMethod, methodName, DataContract.GetClrTypeFullName(type)), type); 2106DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeReturnType, DataContract.GetClrTypeFullName(type), methodName), type); 2111DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeMethodNull, DataContract.GetClrTypeFullName(type)), type); 2117DataContract.ThrowInvalidDataContractException(SR.GetString(SR.KnownTypeAttributeValidMethodTypes, DataContract.GetClrTypeFullName(type)), type); 2200DataContract.ThrowInvalidDataContractException(SR.GetString(SR.TypeMustBeConcrete, type), type); 2217if (collectionElementTypeName.StartsWith(DataContract.GetClrTypeFullName(rootType), StringComparison.Ordinal)) 2240type = DataContract.UnwrapNullableType(type); 2241DataContract dataContract = DataContract.GetDataContract(type); 2242DataContract alreadyExistingContract; 2276DataContract dataContract = other as DataContract; 2463: this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments()) 2474DataContract.GetClrNameAndNamespace(genericTypeName, out name, out ns); 2475this.nestedParamCounts = DataContract.GetDataContractNameForGenericName(name, null); 2514parametersFromBuiltInNamespaces = DataContract.IsBuiltInNamespace(GetStableName(j).Namespace); 2530genericParams[i] = qname = DataContract.GetStableName(paramType); 2532genericParams[i] = qname = ((DataContract)o).StableName; 2577return new XmlQualifiedName(DataContract.EncodeLocalName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(stableName.Name), this)), stableName.Namespace); 2631parametersFromBuiltInNamespaces = DataContract.IsBuiltInNamespace(paramGenericInfos[j].GetStableNamespace());
System\Runtime\Serialization\DataContractSerializer.cs (11)
19using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 24DataContract rootContract; // post-surrogate 98Initialize(type, dictionary.Add(rootName), dictionary.Add(DataContract.GetNamespace(rootNamespace)), knownTypes, maxItemsInObjectGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate, dataContractResolver, false); 254DataContract RootContract 260rootContract = DataContract.GetDataContract(((dataContractSurrogate == null) ? rootType : GetSurrogatedType(dataContractSurrogate, rootType))); 364DataContract contract = RootContract; 413internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 425return DataContract.GetDataContract(objectType.TypeHandle, objectType, SerializationMode.SharedContract); 479DataContract contract = RootContract; 524return DataContractSurrogateCaller.GetDataContractType(dataContractSurrogate, DataContract.UnwrapNullableType(type));
System\Runtime\Serialization\DataContractSet.cs (49)
13using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 18Dictionary<XmlQualifiedName, DataContract> contracts; 19Dictionary<DataContract, object> processedContracts; 47foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet) 54foreach (KeyValuePair<DataContract, object> pair in dataContractSet.processedContracts) 61Dictionary<XmlQualifiedName, DataContract> Contracts 67contracts = new Dictionary<XmlQualifiedName, DataContract>(); 73Dictionary<DataContract, object> ProcessedContracts 79processedContracts = new Dictionary<DataContract, object>(); 103DataContract dataContract = GetDataContract(type); 114void Add(DataContract dataContract) 119public void Add(XmlQualifiedName name, DataContract dataContract) 126internal void InternalAdd(XmlQualifiedName name, DataContract dataContract) 128DataContract dataContractInSet = null; 137bool typeNamesEqual = (DataContract.GetClrTypeFullName(dataContract.UnderlyingType) == DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)); 138throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.DupTypeContractInDataContractSet, (typeNamesEqual ? dataContract.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), (typeNamesEqual ? dataContractInSet.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)), dataContract.StableName.Name, dataContract.StableName.Namespace))); 174DataContract memberDataContract = GetMemberTypeDataContract(dataMember); 200DataContract itemContract = GetItemTypeDataContract(collectionDataContract); 216foreach (DataContract knownDataContract in knownDataContracts.Values) 231return DataContract.GetStableName(dcType); 233return DataContract.GetStableName(clrType); 236internal DataContract GetDataContract(Type clrType) 239return DataContract.GetDataContract(clrType); 240DataContract dataContract = DataContract.GetBuiltInDataContract(clrType); 246dataContract = DataContract.GetDataContract(dcType); 257internal DataContract GetMemberTypeDataContract(DataMember dataMember) 270DataContract.GetClrTypeFullName(dataMemberType), DataContract.GetClrTypeFullName(dataMember.MemberInfo.DeclaringType), dataMember.MemberInfo.Name))); 273return DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(dataMemberType.TypeHandle), dataMemberType.TypeHandle, dataMemberType, SerializationMode.SharedContract); 283internal DataContract GetItemTypeDataContract(CollectionDataContract collectionContract) 300public DataContract this[XmlQualifiedName key] 304DataContract dataContract = DataContract.GetBuiltInDataContract(key.Name, key.Namespace); 320if (DataContract.GetBuiltInDataContract(key.Name, key.Namespace) != null) 325public IEnumerator<KeyValuePair<XmlQualifiedName, DataContract>> GetEnumerator() 330internal bool IsContractProcessed(DataContract dataContract) 335internal void SetContractProcessed(DataContract dataContract) 340internal ContractCodeDomInfo GetContractCodeDomInfo(DataContract dataContract) 348internal void SetContractCodeDomInfo(DataContract dataContract, ContractCodeDomInfo info) 359referencedTypesDictionary.Add(DataContract.GetStableName(Globals.TypeOfNullable), Globals.TypeOfNullable); 388XmlQualifiedName genericDictionaryName = DataContract.GetStableName(Globals.TypeOfDictionaryGeneric); 441internal bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 446internal bool TryGetReferencedCollectionType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 451bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, bool useReferencedCollectionTypes, out Type type) 474DataContract other = this.GetDataContract(conflictingType);
System\Runtime\Serialization\DataMember.cs (18)
45internal DataMember(DataContract memberTypeContract, string name, bool isNullable, bool isRequired, bool emitDefaultValue, int order) 110internal DataContract MemberTypeContract 138DataContract memberTypeContract; 165internal CriticalHelper(DataContract memberTypeContract, string name, bool isNullable, bool isRequired, bool emitDefaultValue, int order) 227internal DataContract MemberTypeContract 237memberTypeContract = DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(MemberType.TypeHandle), MemberType.TypeHandle, MemberType, SerializationMode.SharedContract); 241memberTypeContract = DataContract.GetDataContract(MemberType); 275return DataContract.FieldRequiresMemberAccess(field); 282return DataContract.MethodRequiresMemberAccess(getMethod) || !DataContract.IsTypeVisible(property.PropertyType); 296return DataContract.FieldRequiresMemberAccess(field); 303return DataContract.MethodRequiresMemberAccess(setMethod) || !DataContract.IsTypeVisible(property.PropertyType); 308internal DataMember BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts) 310DataContract memberTypeContract = this.MemberTypeContract.BindGenericParameters(paramContracts, boundContracts);
System\Runtime\Serialization\EnumDataContract.cs (11)
134class EnumDataContractCriticalHelper : DataContract.DataContractCriticalHelper 191this.StableName = DataContract.GetStableName(type, out hasDataContract); 210DataContract.ThrowInvalidDataContractException( 212DataContract.GetClrTypeFullName(type), 287ThrowInvalidDataContractException(SR.GetString(SR.TooManyEnumMembers, DataContract.GetClrTypeFullName(field.DeclaringType), field.Name)); 294ThrowInvalidDataContractException(SR.GetString(SR.InvalidEnumMemberValue, field.Name, DataContract.GetClrTypeFullName(type))); 305ThrowInvalidDataContractException(SR.GetString(SR.DataMemberOnEnumField, DataContract.GetClrTypeFullName(field.DeclaringType), field.Name)); 372throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)))); 378throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)))); 418throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnRead, stringValue, DataContract.GetClrTypeFullName(UnderlyingType)))); 437throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType))));
System\Runtime\Serialization\ExtensionDataReader.cs (1)
655throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.InvalidDataNode, DataContract.GetClrTypeFullName(type))));
System\Runtime\Serialization\GenericParameterDataContract.cs (6)
45class GenericParameterDataContractCriticalHelper : DataContract.DataContractCriticalHelper 52SetDataContractName(DataContract.GetStableName(type)); 62internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts)
System\Runtime\Serialization\IDataContractSurrogate.cs (5)
27if (DataContract.GetBuiltInDataContract(type) != null) 39if (DataContract.GetBuiltInDataContract(objType) != null) 47if (DataContract.GetBuiltInDataContract(objType) != null) 57if (DataContract.GetBuiltInDataContract(clrType) != null) 67if (DataContract.GetBuiltInDataContract(typeName, typeNamespace) != null)
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (13)
16using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 29DataContract rootContract; // post-surrogate 204DataContract RootContract 210rootContract = DataContract.GetDataContract(((dataContractSurrogate == null) ? rootType : 321if (!DataContract.IsValidNCName(jsonName)) 372internal static object ReadJsonValue(DataContract contract, XmlReaderDelegator reader, XmlObjectSerializerReadContextComplexJson context) 426DataContract contract = RootContract; 455DataContract contract = RootContract; 583internal static void CheckIfTypeIsReference(DataContract dataContract) 590DataContract.GetClrTypeFullName(dataContract.UnderlyingType), 595internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 597DataContract contract = DataContractSerializer.GetDataContract(declaredTypeContract, declaredType, objectType);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (2)
45DataContract.ThrowInvalidDataContractException(TraditionalClassDataContract.DeserializationExceptionMessage, null /*type*/); 174DataContract.GetClrTypeFullName(traditionalClassDataContract.UnderlyingType), traditionalClassDataContract.MemberNames[i].Value)));
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (3)
42DataContract.ThrowInvalidDataContractException(TraditionalCollectionDataContract.DeserializationExceptionMessage, null /*type*/); 70throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(this.TraditionalDataContract.UnderlyingType)))); 74DataContract.ThrowInvalidDataContractException(TraditionalCollectionDataContract.DeserializationExceptionMessage, null /*type*/);
System\Runtime\Serialization\Json\JsonDataContract.cs (16)
29protected JsonDataContract(DataContract traditionalDataContract) 55protected DataContract TraditionalDataContract 63Dictionary<XmlQualifiedName, DataContract> KnownDataContracts 74public static JsonDataContract GetJsonDataContract(DataContract traditionalDataContract) 159Dictionary<XmlQualifiedName, DataContract> knownDataContracts; 160DataContract traditionalDataContract; 163internal JsonDataContractCriticalHelper(DataContract traditionalDataContract) 170internal Dictionary<XmlQualifiedName, DataContract> KnownDataContracts 175internal DataContract TraditionalDataContract 185public static JsonDataContract GetJsonDataContract(DataContract traditionalDataContract) 234static JsonDataContract CreateJsonDataContract(int id, DataContract traditionalDataContract) 302foreach (KeyValuePair<XmlQualifiedName, DataContract> knownDataContract in traditionalDataContract.KnownDataContracts) 309DataContract itemContract = collectionDataContract.ItemContract; 312knownDataContracts = new Dictionary<XmlQualifiedName, DataContract>(); 323DataContract itemDataContract = DataContract.GetDataContract(Globals.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GetGenericArguments()));
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (11)
290ilg.Call(null, JsonFormatGeneratorStatics.GetUninitializedObjectMethod, DataContract.GetIdForInitialization(classContract)); 509throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.SerializationInfo_ConstructorNotFound, DataContract.GetClrTypeFullName(classContract.UnderlyingType)))); 534ilg.Call(contextArg, XmlFormatGeneratorStatics.ReadIfNullOrRefMethod, xmlReaderArg, type, DataContract.IsTypeSerializable(type)); 544ThrowSerializationException(SR.GetString(SR.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName(type))); 560ThrowSerializationException(SR.GetString(SR.ValueTypeCannotHaveId, DataContract.GetClrTypeFullName(type))); 583ThrowSerializationException(SR.GetString(SR.ValueTypeCannotHaveRef, DataContract.GetClrTypeFullName(type))); 613ilg.Load(DataContract.GetId(declaredType.TypeHandle)); 780DataContract keyDataContract = keyValueDataContract.Members[0].MemberTypeContract; 802DataContract.GetClrTypeFullName(collectionContract.UnderlyingType), 803DataContract.GetClrTypeFullName(keyType))); 1018ClassDataContract keyValuePairContract = DataContract.GetDataContract(value.LocalType) as ClassDataContract;
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
690ilg.Call(contextArg, XmlFormatGeneratorStatics.WriteNullMethod, xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 716ilg.Call(contextArg, XmlFormatGeneratorStatics.WriteNullMethod, xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 742ilg.Load(DataContract.GetId(memberType.TypeHandle));
System\Runtime\Serialization\Json\JsonObjectDataContract.cs (2)
14public JsonObjectDataContract(DataContract traditionalDataContract) 46return DataContractJsonSerializer.ReadJsonValue(DataContract.GetDataContract(Globals.TypeOfObjectArray), jsonReader, context);
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (3)
62Dictionary<XmlQualifiedName, DataContract>[] entries = context.scopedKnownTypes.dataContractDictionaries; 67Dictionary<XmlQualifiedName, DataContract> entry = entries[i]; 70foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in entry)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (13)
25public XmlObjectSerializerReadContextComplexJson(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 116internal static XmlObjectSerializerReadContextComplexJson CreateContext(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 130protected override object ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) 257SR.JsonOneRequiredMemberNotFound, DataContract.GetClrTypeFullName(obj.GetType()), stringBuilder.ToString()))); 262SR.JsonRequiredMembersNotFound, DataContract.GetClrTypeFullName(obj.GetType()), stringBuilder.ToString()))); 271SR.GetString(SR.JsonDuplicateMemberInInput, DataContract.GetClrTypeFullName(obj.GetType()), memberNames[memberIndex]))); 297internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 299DataContract dataContract = base.GetDataContract(typeHandle, type); 304internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 306DataContract dataContract = base.GetDataContractSkipValidation(typeId, typeHandle, type); 311internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 313DataContract dataContract = base.GetDataContract(id, typeHandle); 318protected override DataContract ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (30)
21public XmlObjectSerializerWriteContextComplexJson(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 35internal static XmlObjectSerializerWriteContextComplexJson CreateContext(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 61internal override bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 106static bool RequiresJsonTypeInfo(DataContract contract) 116protected override bool WriteTypeInfo(XmlWriterDelegator writer, DataContract contract, DataContract declaredContract) 167if (DataContract.GetClrTypeFullName(objType) != serInfo.FullTypeName) 169throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ChangingFullTypeNameNotSupported, serInfo.FullTypeName, DataContract.GetClrTypeFullName(objType)))); 181internal static DataContract GetRevisedItemContract(DataContract oldItemContract) 188return DataContract.GetDataContract(oldItemContract.UnderlyingType); 193protected override void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 248DataContract dc = GetDataContract(dataNode.Value.GetType()); 258DataContract dataContract; 273DataContract declaredTypeContract = (declaredTypeID >= 0) 287static void VerifyObjectCompatibilityWithInterface(DataContract contract, object graph, Type declaredType) 301void HandleCollectionAssignedToObject(Type declaredType, ref DataContract dataContract, ref object obj, ref bool verifyKnownType) 325internal override void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 345void VerifyType(DataContract dataContract, Type declaredType) 356throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.StableName.Name, dataContract.StableName.Namespace))); 365internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 367DataContract dataContract = base.GetDataContract(typeHandle, type); 372internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 374DataContract dataContract = base.GetDataContractSkipValidation(typeId, typeHandle, type); 379internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 381DataContract dataContract = base.GetDataContract(id, typeHandle); 386internal static DataContract ResolveJsonDataContractFromRootDataContract(XmlObjectSerializerContext context, XmlQualifiedName typeQName, DataContract rootTypeDataContract) 394DataContract itemContract; 413protected override DataContract ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName)
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (2)
38DataContract contract = DataContract.GetDataContract(type);
System\Runtime\Serialization\NetDataContractSerializer.cs (28)
29DataContract cachedDataContract; 64Initialize(dictionary.Add(rootName), dictionary.Add(DataContract.GetNamespace(rootNamespace)), context, maxItemsInObjectGraph, ignoreExtensionDataObject, assemblyFormat, surrogateSelector); 185DataContract contract = GetDataContract(graph, ref surrogateDataContracts); 220DataContract contract = GetDataContract(graph, ref surrogateDataContracts); 224void InternalWriteStartObject(XmlWriterDelegator writer, object graph, DataContract contract) 237DataContract contract = GetDataContract(graph, ref surrogateDataContracts); 241void InternalWriteObjectContent(XmlWriterDelegator writer, object graph, DataContract contract, Hashtable surrogateDataContracts) 273internal static void WriteClrTypeInfo(XmlWriterDelegator writer, DataContract dataContract, SerializationBinder binder) 302throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.TypeCannotBeForwardedFrom, DataContract.GetClrTypeFullName(clrType), clrType.Assembly.FullName, clrAssemblyName))); 379writer.WriteAttributeString(Globals.SerPrefix, DictionaryGlobals.ClrTypeLocalName, DictionaryGlobals.SerializationNamespace, DataContract.GetClrTypeString(clrTypeName)); 381writer.WriteAttributeString(Globals.SerPrefix, DictionaryGlobals.ClrAssemblyLocalName, DictionaryGlobals.SerializationNamespace, DataContract.GetClrTypeString(clrAssemblyName)); 439internal DataContract GetDataContract(object obj, ref Hashtable surrogateDataContracts) 444internal DataContract GetDataContract(Type type, ref Hashtable surrogateDataContracts) 449internal DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type, ref Hashtable surrogateDataContracts) 451DataContract dataContract = GetDataContractFromSurrogateSelector(surrogateSelector, Context, typeHandle, type, ref surrogateDataContracts); 457dataContract = DataContract.GetDataContract(typeHandle, type, SerializationMode.SharedType); 462DataContract currentCachedDataContract = cachedDataContract; 466return DataContract.GetDataContract(typeHandle, type, SerializationMode.SharedType); 479internal static DataContract GetDataContractFromSurrogateSelector(ISurrogateSelector surrogateSelector, StreamingContext context, RuntimeTypeHandle typeHandle, Type type, ref Hashtable surrogateDataContracts) 486DataContract builtInDataContract = DataContract.GetBuiltInDataContract(type); 491DataContract cachedSurrogateContract = (DataContract)surrogateDataContracts[type]; 495DataContract surrogateContract = null; 502DataContract itemContract = GetDataContractFromSurrogateSelector(surrogateSelector, context, elementType.TypeHandle, elementType, ref surrogateDataContracts); 504itemContract = DataContract.GetDataContract(elementType.TypeHandle, elementType, SerializationMode.SharedType); 525string assemblyName = DataContract.GetClrAssemblyName(type, out hasTypeForwardedFrom); 526typeInformation = new TypeInformation(DataContract.GetClrTypeFullNameUsingTypeForwardedFromAttribute(type), assemblyName, hasTypeForwardedFrom);
System\Runtime\Serialization\PrimitiveDataContract.cs (3)
36return DataContract.GetBuiltInDataContract(type) as PrimitiveDataContract; 41return DataContract.GetBuiltInDataContract(name, ns) as PrimitiveDataContract; 162class PrimitiveDataContractCriticalHelper : DataContract.DataContractCriticalHelper
System\Runtime\Serialization\SchemaExporter.cs (29)
56foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet) 58DataContract dataContract = pair.Value; 85void ExportDataContract(DataContract dataContract) 112XmlSchemaElement ExportTopLevelElement(DataContract dataContract, XmlSchema schema) 142DataContract memberTypeContract = dataContractSet.GetMemberTypeDataContract(dataMember); 190void SetElementType(XmlSchemaElement element, DataContract dataContract, XmlSchema schema) 262if (DataContract.GetBuiltInDataContract(clrType) != null 284typeName = DataContract.GetClrTypeFullName(clrType).Substring(nsLen).Replace('+', '.'); 289genericArgumentCounts = DataContract.GetDataContractNameForGenericName(typeName, null); 292XmlQualifiedName dcqname = DataContract.GetStableName(clrType); 298dcqname = new XmlQualifiedName(collectionName, DataContract.GetCollectionNamespace(dcqname.Namespace)); 401DataContract itemContract = dataContractSet.GetItemTypeDataContract(collectionDataContract); 530throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.MissingSchemaType, typeQName, DataContract.GetClrTypeFullName(clrType)))); 605throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidXmlDataContractName, DataContract.GetClrTypeFullName(type)))); 615stableName = DataContract.GetDefaultStableName(clrType); 629throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidGetSchemaMethod, DataContract.GetClrTypeFullName(clrType)))); 630stableName = DataContract.GetDefaultStableName(clrType); 636throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName))); 639throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName), typeof(XmlSchemaType)))); 646throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName))); 647stableName = DataContract.GetDefaultStableName(clrType); 653stableName = DataContract.GetDefaultStableName(clrType); 664DataContract.GetDefaultStableName(DataContract.GetClrTypeFullName(clrType), out typeName, out typeNs); 687throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.MissingSchemaType, typeName, DataContract.GetClrTypeFullName(clrType)))); 709throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidReturnSchemaOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType)))); 768typeName = new XmlQualifiedName(name, DataContract.GetDefaultStableNamespace(type));
System\Runtime\Serialization\SchemaImporter.cs (30)
18using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 187internal static bool IsObjectContract(DataContract dataContract) 229DataContract dataContract = ImportType(knownType); 230DataContract existingContract; 359DataContract ImportAnonymousGlobalElement(XmlSchemaElement element, XmlQualifiedName typeQName, string ns) 361DataContract contract = ImportAnonymousElement(element, typeQName); 371DataContract ImportAnonymousElement(XmlSchemaElement element, XmlQualifiedName typeQName) 390DataContract ImportType(XmlQualifiedName typeName) 392DataContract dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace); 405DataContract ImportType(XmlSchemaType type) 411DataContract ImportType(XmlSchemaType type, XmlQualifiedName typeName, bool isAnonymous) 413DataContract dataContract = dataContractSet[typeName]; 561DataContract baseContract = ImportType(restriction.BaseType); 629DataContract ImportType(XmlQualifiedName typeName, XmlSchemaParticle rootParticle, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlQualifiedName baseTypeName, XmlSchemaAnnotation annotation) 631DataContract dataContract = null; 705DataContract ImportXmlDataType(XmlQualifiedName typeName, XmlSchemaType xsdType, bool isAnonymous) 707DataContract dataContract = dataContractSet[typeName]; 768return (XmlDataContract)DataContract.GetBuiltInDataContract(Globals.TypeOfXmlElement); 771return (XmlDataContract)DataContract.GetBuiltInDataContract(Globals.TypeOfXmlNodeArray); 975DataContract memberTypeContract = null; 1090DataContract contract = dataContractSet[shortName]; 1131GenericInfo genericInfo = new GenericInfo(DataContract.GetStableName(Globals.TypeOfKeyValue), Globals.TypeOfKeyValue.FullName); 1147genericInfo = new GenericInfo(DataContract.GetStableName(Globals.TypeOfNullable), Globals.TypeOfNullable.FullName); 1230DataContract ImportSimpleTypeRestriction(XmlQualifiedName typeName, XmlSchemaSimpleTypeRestriction restriction) 1232DataContract dataContract = null; 1244void ImportDataContractExtension(XmlSchemaType type, DataContract dataContract) 1272void ImportGenericInfo(XmlSchemaType type, DataContract dataContract) 1307name = DataContract.EncodeLocalName(name); 1417void AddDataContract(DataContract dataContract)
System\Runtime\Serialization\ScopedKnownTypes.cs (3)
9using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 29internal DataContract GetDataContract(XmlQualifiedName qname) 34DataContract dataContract;
System\Runtime\Serialization\SpecialTypeDataContract.cs (1)
49class SpecialTypeDataContractCriticalHelper : DataContract.DataContractCriticalHelper
System\Runtime\Serialization\SurrogateDataContract.cs (3)
105class SurrogateDataContractCriticalHelper : DataContract.DataContractCriticalHelper 114DataContract.GetDefaultStableName(DataContract.GetClrTypeFullName(type), out name, out ns);
System\Runtime\Serialization\XmlDataContract.cs (11)
15using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 178class XmlDataContractCriticalHelper : DataContract.DataContractCriticalHelper 198throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IXmlSerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)))); 200throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IXmlSerializableCannotHaveCollectionDataContract, DataContract.GetClrTypeFullName(type)))); 228topLevelElementName = (elementName == null || elementName.Length == 0) ? Name : dictionary.Add(DataContract.EncodeLocalName(elementName)); 234throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IsAnyCannotHaveXmlRoot, DataContract.GetClrTypeFullName(UnderlyingType)))); 249knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 318throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IXmlSerializableMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type)))); 345ilg.BeginMethod("Create" + DataContract.GetClrTypeFullName(type), typeof(CreateXmlSerializableDelegate), memberAccessFlag); 384new SecurityException(SR.GetString(SR.PartialTrustIXmlSerializableTypeNotPublic, DataContract.GetClrTypeFullName(UnderlyingType)), 395new SecurityException(SR.GetString(SR.PartialTrustIXmlSerialzableNoPublicConstructor, DataContract.GetClrTypeFullName(UnderlyingType)),
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (5)
851writeXmlValueMethod = typeof(DataContract).GetMethod("WriteXmlValue", Globals.ScanAllMembers); 864readXmlValueMethod = typeof(DataContract).GetMethod("ReadXmlValue", Globals.ScanAllMembers); 877throwTypeNotSerializableMethod = typeof(DataContract).GetMethod("ThrowTypeNotSerializable", Globals.ScanAllMembers); 890namespaceProperty = typeof(DataContract).GetProperty("Namespace", Globals.ScanAllMembers); 1020throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException", Globals.ScanAllMembers, null, new Type[] { typeof(string), typeof(Type) }, null);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (8)
283ilg.Call(null, XmlFormatGeneratorStatics.GetUninitializedObjectMethod, DataContract.GetIdForInitialization(classContract)); 490ilg.Call(contextArg, XmlFormatGeneratorStatics.ReadIfNullOrRefMethod, xmlReaderArg, type, DataContract.IsTypeSerializable(type)); 500ThrowValidationException(SR.GetString(SR.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName(type))); 516ThrowValidationException(SR.GetString(SR.ValueTypeCannotHaveId, DataContract.GetClrTypeFullName(type))); 539ThrowValidationException(SR.GetString(SR.ValueTypeCannotHaveRef, DataContract.GetClrTypeFullName(type))); 569ilg.Load(DataContract.GetId(declaredType.TypeHandle)); 869ClassDataContract keyValuePairContract = DataContract.GetDataContract(value.LocalType) as ClassDataContract; 959return FormatterServices.GetUninitializedObject(DataContract.GetDataContractForInitialization(id).TypeForInitialization);
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (3)
667ilg.Call(contextArg, XmlFormatGeneratorStatics.WriteNullMethod, xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 693ilg.Call(contextArg, XmlFormatGeneratorStatics.WriteNullMethod, xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 719ilg.Load(DataContract.GetId(memberType.TypeHandle));
System\Runtime\Serialization\XmlObjectSerializer.cs (10)
16using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 199internal void WriteRootElement(XmlWriterDelegator writer, DataContract contract, XmlDictionaryString name, XmlDictionaryString ns, bool needsContractNsAtRoot) 217internal bool CheckIfNeedsContractNsAtRoot(XmlDictionaryString name, XmlDictionaryString ns, DataContract contract) 237internal static bool IsContractDeclared(DataContract contract, DataContract declaredContract) 343internal bool IsRootXmlAny(XmlDictionaryString rootName, DataContract contract) 353internal bool IsRootElement(XmlReaderDelegator reader, DataContract contract, XmlDictionaryString name, XmlDictionaryString ns) 379DataContract objectContract = PrimitiveDataContract.GetPrimitiveDataContract(Globals.TypeOfObject); 418return (type == null) ? string.Empty : DataContract.GetClrTypeFullName(type); 423string typeInfo = (type == null) ? string.Empty : SR.GetString(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(type));
System\Runtime\Serialization\XmlObjectSerializerContext.cs (29)
13using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 22protected DataContract rootTypeDataContract; 57internal XmlObjectSerializerContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 160internal DataContract GetDataContract(Type type) 165internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 169return DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(typeHandle), typeHandle, type, Mode); 173return DataContract.GetDataContract(typeHandle, type, Mode); 177internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 181return DataContract.GetGetOnlyCollectionDataContractSkipValidation(typeId, typeHandle, type); 185return DataContract.GetDataContractSkipValidation(typeId, typeHandle, type); 190internal virtual DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 194return DataContract.GetGetOnlyCollectionDataContract(id, typeHandle, null /*type*/, Mode); 198return DataContract.GetDataContract(id, typeHandle, Mode); 227DataContract GetDataContractFromSerializerKnownTypes(XmlQualifiedName qname) 232DataContract outDataContract; 247DataContract.CheckAndAdd(knownType, typesChecked, ref dataContracts); 252internal bool IsKnownType(DataContract dataContract, DataContractDictionary knownDataContracts, Type declaredType) 270internal bool IsKnownType(DataContract dataContract, Type declaredType) 272DataContract knownContract = ResolveDataContractFromKnownTypes(dataContract.StableName.Name, dataContract.StableName.Namespace, null /*memberTypeContract*/, declaredType); 276DataContract ResolveDataContractFromKnownTypes(XmlQualifiedName typeName) 278DataContract dataContract = PrimitiveDataContract.GetPrimitiveDataContract(typeName.Name, typeName.Namespace); 290DataContract ResolveDataContractFromDataContractResolver(XmlQualifiedName typeName, Type declaredType) 310DataContract dataContract = ResolveDataContractFromKnownTypes(typeName); 321protected DataContract ResolveDataContractFromKnownTypes(string typeName, string typeNs, DataContract memberTypeContract, Type declaredType) 324DataContract dataContract; 349protected virtual DataContract ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName) 357DataContract itemContract = GetDataContract(GetSurrogatedType(collectionContract.ItemType));
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (20)
85throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.NullValueReturnedForGetOnlyCollection, DataContract.GetClrTypeFullName(type)))); 94throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ArrayExceededSize, arraySize, DataContract.GetClrTypeFullName(type)))); 97internal static XmlObjectSerializerReadContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 114internal XmlObjectSerializerReadContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 128DataContract dataContract = GetDataContract(id, declaredTypeHandle); 134DataContract dataContract = GetDataContract(declaredType); 138internal virtual object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, string name, string ns) 153throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IsReferenceGetOnlyCollectionsNotSupported, attributes.Ref, DataContract.GetClrTypeFullName(declaredType)))); 170protected object InternalDeserialize(XmlReaderDelegator reader, string name, string ns, Type declaredType, ref DataContract dataContract) 199DataContract factoryDataContract = ResolveDataContractFromKnownTypes(attributes.FactoryTypeName, attributes.FactoryTypeNamespace, dataContract, declaredType); 208throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.FactoryTypeNotISerializable, DataContract.GetClrTypeFullName(factoryDataContract.UnderlyingType), DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 235bool ReplaceScopedKnownTypesTop(Dictionary<XmlQualifiedName, DataContract> knownDataContracts, bool knownTypesAddedInCurrentScope) 400throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.FactoryObjectContainsSelfReference, DataContract.GetClrTypeFullName(oldObj.GetType()), DataContract.GetClrTypeFullName(newObj.GetType()), id))); 439throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.GetRealObjectReturnedNull, DataContract.GetClrTypeFullName(obj.GetType())))); 486DataContract.GetClrTypeFullName(typeof(T))))); 603protected virtual DataContract ResolveDataContractFromTypeName() 668DataContract dataContract = ResolveDataContractFromTypeName(); 1078protected virtual object ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (19)
15using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; 39internal XmlObjectSerializerReadContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 67internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 69DataContract dataContract = null; 80DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 88internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 90DataContract dataContract = null; 101DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 139internal override object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, string name, string ns) 160DataContract dataContract; 192object InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, string name, string ns) 199DataContract dataContract = surrogateDataContract ?? 204DataContract.GetClrTypeFullName(declaredType)))); 293DataContract ResolveDataContractInSharedTypeMode(string assemblyName, string typeName, out Assembly assembly, out Type type) 304protected override DataContract ResolveDataContractFromTypeName() 347if (!DataContract.IsTypeSerializable(memberType)) 364type = DataContract.UnwrapNullableType(type); 369DataContract.GetClrTypeFullName(type)))); 439throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.CannotDeserializeForwardedType, DataContract.GetClrTypeFullName(resolvedType))));
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (32)
38internal static XmlObjectSerializerWriteContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 50protected XmlObjectSerializerWriteContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver resolver) 126DataContract contract = GetDataContract(declaredTypeID, declaredTypeHandle); 134DataContract dataContract = (declaredTypeID >= 0) 146internal void SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 162internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 183DataContract dataContract; 187dataContract = GetDataContractSkipValidation(DataContract.GetId(objectTypeHandle), objectTypeHandle, objectType); 217DataContract declaredTypeContract = (declaredTypeID >= 0) 227internal bool OnHandleIsReference(XmlWriterDelegator xmlWriter, DataContract contract, object obj) 250protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 263throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.StableName.Name, dataContract.StableName.Namespace))); 274internal virtual bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 361internal void HandleGraphAtTopLevel(XmlWriterDelegator writer, object obj, DataContract contract) 380throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.CannotSerializeObjectWithCycles, DataContract.GetClrTypeFullName(obj.GetType())))); 485throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.UnknownXmlType, DataContract.GetClrTypeFullName(obj.GetType())))); 511throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ISerializableAssemblyNameSetToZero, DataContract.GetClrTypeFullName(obj.GetType())))); 519if (DataContract.GetClrTypeFullName(objType) != serInfo.FullTypeName) 532DataContract.GetDefaultStableName(serInfo.FullTypeName, out typeName, out typeNs); 533xmlWriter.WriteAttributeQualifiedName(Globals.SerPrefix, DictionaryGlobals.ISerializableFactoryTypeLocalName, DictionaryGlobals.SerializationNamespace, DataContract.GetClrTypeString(typeName), DataContract.GetClrTypeString(typeNs)); 541XmlDictionaryString name = DataContract.GetClrTypeString(DataContract.EncodeLocalName(serEntry.Name)); 721protected virtual void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 744throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ResolveTypeReturnedFalse, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 754throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 759throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 764protected virtual bool WriteTypeInfo(XmlWriterDelegator writer, DataContract contract, DataContract declaredContract)
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (15)
34internal XmlObjectSerializerWriteContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 63internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 65DataContract dataContract = null; 76DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 84internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 86DataContract dataContract = null; 97DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 105internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 107DataContract dataContract = null; 118DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 126internal override bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 299if (!DataContract.IsTypeSerializable(memberType)) 316type = DataContract.UnwrapNullableType(type); 321DataContract.GetClrTypeFullName(type)))); 356DataContract contract = GetDataContract(objTypeHandle, objType);
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
222DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\XmlSerializableWriter.cs (3)
25throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IXmlSerializableMissingEndElements, (obj == null ? string.Empty : DataContract.GetClrTypeFullName(obj.GetType()))))); 54throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IXmlSerializableWritePastSubTree, (obj == null ? string.Empty : DataContract.GetClrTypeFullName(obj.GetType()))))); 62throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IXmlSerializableWritePastSubTree, (obj == null ? string.Empty : DataContract.GetClrTypeFullName(obj.GetType())))));
System\Runtime\Serialization\XmlWriterDelegator.cs (1)
281return new InvalidDataContractException(SR.GetString(SR.InvalidPrimitiveType, DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\XPathQueryGenerator.cs (6)
35DataContract currentContract = DataContract.GetDataContract(type); 57static DataContract ProcessDataContract(DataContract contract, ExportContext context, MemberInfo memberNode) 66static DataContract ProcessClassDataContract(ClassDataContract contract, ExportContext context, MemberInfo memberNode) 104public ExportContext(DataContract rootContract)
System\Runtime\Serialization\XsdDataContractExporter.cs (7)
193DataContract dataContract = DataContract.GetDataContract(type); 206DataContract dataContract = DataContract.GetDataContract(type); 219DataContract dataContract = DataContract.GetDataContract(type); 242if (!type.ContainsGenericParameters && DataContract.IsTypeSerializable(type))
System\Runtime\Serialization\XsdDataContractImporter.cs (7)
172DataContract dataContract = FindDataContract(typeName); 183DataContract dataContract = FindDataContract(typeName); 189internal DataContract FindDataContract(XmlQualifiedName typeName) 194DataContract dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace); 209DataContract dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace);