8 types derived from DataContract
dotnet-svcutil-lib (8)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (1)
23internal sealed class ClassDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (1)
121internal sealed class CollectionDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (1)
22internal sealed class EnumDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
36internal sealed class ExceptionDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\GenericParameterDataContract.cs (1)
11internal sealed class GenericParameterDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\PrimitiveDataContract.cs (1)
19internal abstract class PrimitiveDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SpecialTypeDataContract.cs (1)
13internal sealed class SpecialTypeDataContract : DataContract
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (1)
23internal sealed class XmlDataContract : DataContract
586 references to DataContract
dotnet-svcutil-lib (586)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (57)
16using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 371DataContract.ThrowInvalidDataContractException( 375DataContract.GetClrTypeFullName(declaringType), 383internal static XmlDictionaryString GetChildNamespaceToDeclare(DataContract dataContract, Type childType, XmlDictionary dictionary) 385childType = DataContract.UnwrapNullableType(childType); 387&& DataContract.GetBuiltInDataContract(childType) == null && childType != Globals.TypeOfDBNull) 389string ns = DataContract.GetStableName(childType).Namespace; 532throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 541throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 564DataContract.GetClrTypeFullName(UnderlyingType)), 583DataContract.GetClrTypeFullName(UnderlyingType)), 596DataContract.GetClrTypeFullName(UnderlyingType), 610DataContract.GetClrTypeFullName(UnderlyingType), 630DataContract.GetClrTypeFullName(UnderlyingType), 639DataContract.GetClrTypeFullName(UnderlyingType), 668DataContract.GetClrTypeFullName(UnderlyingType)), 684DataContract.GetClrTypeFullName(this.UnderlyingType), 698DataContract.GetClrTypeFullName(UnderlyingType), 718DataContract.GetClrTypeFullName(UnderlyingType), 727DataContract.GetClrTypeFullName(UnderlyingType), 745private class ClassDataContractCriticalHelper : DataContract.DataContractCriticalHelper 802DataContract baseContract = DataContract.GetDataContract(baseType); 811DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(baseType)))); 887DataContract.ThrowInvalidDataContractException( 889DataContract.GetClrTypeFullName(type), 891DataContract.GetClrTypeFullName(this.BaseContract.UnderlyingType), 913DataContract.ThrowInvalidDataContractException( 915DataContract.GetClrTypeFullName(type), 954ThrowInvalidDataContractException(string.Format(SRSerialization.TooManyDataMembers, DataContract.GetClrTypeFullName(member.DeclaringType), member.Name)); 981ThrowInvalidDataContractException(string.Format(SRSerialization.InvalidMember, DataContract.GetClrTypeFullName(type), member.Name)); 987ThrowInvalidDataContractException(string.Format(SRSerialization.InvalidDataMemberName, member.Name, DataContract.GetClrTypeFullName(type))); 993memberContract.Name = DataContract.EncodeLocalName(memberContract.Name); 994memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 1000DataContract.GetClrTypeFullName(member.DeclaringType), 1019ThrowInvalidDataContractException(string.Format(SRSerialization.TooManyIgnoreDataMemberAttributes, DataContract.GetClrTypeFullName(member.DeclaringType), member.Name)); 1043memberContract.Name = DataContract.EncodeLocalName(member.Name); 1044memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 1058memberContract.Name = DataContract.EncodeLocalName(member.Name); 1066DataContract.GetClrTypeFullName(member.DeclaringType), 1071memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 1172return DataContract.GetStableName(type, out _hasDataContract); 1230DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.DuplicateCallback, method, currentCallback, DataContract.GetClrTypeFullName(method.DeclaringType), attributeType), method.DeclaringType); 1232DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.DuplicateAttribute, prevAttributeType, attributeType, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1234DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.CallbacksCannotBeVirtualMethods, method, DataContract.GetClrTypeFullName(method.DeclaringType), attributeType), method.DeclaringType); 1238DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.CallbackMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1240DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.CallbackParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method, Globals.TypeOfStreamingContext), method.DeclaringType); 1314_knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 1401throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.NonAttributedSerializableTypesMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (66)
19using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 56foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet) 58DataContract dataContract = pair.Value; 228private bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 265foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in _dataContractSet) 267DataContract dataContract = pair.Value; 286throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(dataContract.GetType()), DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 348internal CodeTypeReference GetCodeTypeReference(DataContract dataContract) 364internal CodeTypeReference GetElementTypeReference(DataContract dataContract, bool isElementTypeNullable) 374get { return DataContract.GetStableName(Globals.TypeOfListGeneric); } 384get { return DataContract.GetStableName(Globals.TypeOfDictionaryGeneric); } 392private ContractCodeDomInfo GetContractCodeDomInfo(DataContract dataContract) 403private void GenerateType(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 462private CodeTypeDeclaration GetNestedType(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 471DataContract containingDataContract = _dataContractSet[new XmlQualifiedName(containingTypeName, dataContract.StableName.Namespace)]; 507private static CodeTypeDeclaration CreateTypeDeclaration(string typeName, DataContract dataContract) 531private CodeTypeReference GetReferencedType(DataContract dataContract) 560throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.TypeMustBeIXmlSerializable, DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(Globals.TypeOfIXmlSerializable), dataContract.StableName.Name, dataContract.StableName.Namespace))); 562DataContract referencedContract = _dataContractSet.GetDataContract(type); 573DataContract referencedContract; 604DataContract itemContract = collectionContract.ItemContract; 620DataContract itemContract = collectionContract.ItemContract; 658private bool TryGetReferencedListType(DataContract itemContract, bool isItemTypeNullable, out CodeTypeReference typeReference) 671private CodeTypeReference GetSurrogatedTypeReference(DataContract dataContract) 691private CodeTypeReference GetReferencedGenericType(GenericInfo genInfo, out DataContract dataContract) 716DataContract[] paramContracts = new DataContract[genInfo.Parameters.Count]; 721DataContract paramContract = _dataContractSet[stableName]; 746dataContract = DataContract.GetDataContract(type).BindGenericParameters(paramContracts, new Dictionary<DataContract, DataContract>()); 792string reencodedName = DataContract.EncodeLocalName(decodedName); 815CodeAttributeDeclaration dataContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfDataContractAttribute)); 880CodeAttributeDeclaration dataMemberAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfDataMemberAttribute)); 904return (DataContract.GetDefaultStableNamespace(clrNamespace) != dataContractNamespace); 907internal ICollection<CodeTypeReference> GetKnownTypeReferences(DataContract dataContract) 913ICollection<DataContract> knownTypeContracts = knownTypeDictionary.Values; 918foreach (DataContract knownTypeContract in knownTypeContracts) 925private DataContractDictionary GetKnownTypeContracts(DataContract dataContract) 937return GetKnownTypeContracts((ClassDataContract)dataContract, new Dictionary<DataContract, object>()); 942private DataContractDictionary GetKnownTypeContracts(ClassDataContract dataContract, Dictionary<DataContract, object> handledContracts) 953DataContract memberContract = dataMember.MemberTypeContract; 986foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in knownContracts) 995DataContractDictionary knownContractDictionary = GetKnownTypeContracts(dataContract, new Dictionary<DataContract, object>()); 999ICollection<DataContract> knownTypeContracts = knownContractDictionary.Values; 1000foreach (DataContract knownTypeContract in knownTypeContracts) 1002CodeAttributeDeclaration knownTypeAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfKnownTypeAttribute)); 1024type.BaseTypes.Add(DataContract.GetClrTypeFullName(Globals.TypeOfIExtensibleDataObject)); 1052private void ThrowIfReferencedBaseTypeSealed(Type baseType, DataContract dataContract) 1055throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRSerialization.CannotDeriveFromSealedReferenceType, dataContract.StableName.Name, dataContract.StableName.Namespace, DataContract.GetClrTypeFullName(baseType)))); 1069type.CustomAttributes.Add(new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfFlagsAttribute))); 1074CodeAttributeDeclaration dataContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfDataContractAttribute)); 1093CodeAttributeDeclaration enumMemberAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfEnumMemberAttribute)); 1133DataContract itemContract = collectionContract.ItemContract; 1154string expectedTypeNs = DataContract.GetCollectionNamespace(itemContract.StableName.Namespace); 1157expectedTypeName, expectedTypeNs, DataContract.GetClrTypeFullName(Globals.TypeOfIListGeneric), DataContract.GetClrTypeFullName(Globals.TypeOfICollectionGeneric)))); 1164CodeAttributeDeclaration collectionContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfCollectionDataContractAttribute)); 1198type.BaseTypes.Add(DataContract.GetClrTypeFullName(Globals.TypeOfIXmlSerializable)); 1208DataContract.GetClrTypeFullName(Globals.TypeOfXmlSchemaProviderAttribute), 1216DataContract.GetClrTypeFullName(Globals.TypeOfXmlSchemaProviderAttribute), 1235CodeAttributeDeclaration xmlRootAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfXmlRootAttribute)); 1276CodeAttributeDeclaration namespaceAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(Globals.TypeOfContractNamespaceAttribute)); 1360private string GetClrNamespace(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (9)
833throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.CanOnlyStoreIntoArgOrLocGot0, DataContract.GetClrTypeFullName(var.GetType())))); 1025throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.UnknownConstantType, DataContract.GetClrTypeFullName(valueType)))); 1276throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ArrayTypeIsNotSupported, DataContract.GetClrTypeFullName(arrayElementType)))); 1338throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ArrayTypeIsNotSupported, DataContract.GetClrTypeFullName(arrayElementType)))); 1514throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.NoConversionPossibleTo, DataContract.GetClrTypeFullName(target)))); 1529throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source)))); 1549throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (51)
16using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 141private DataContract _itemContract; 203private void InitCollectionDataContract(DataContract sharedTypeContract) 248public DataContract ItemContract 270internal DataContract SharedTypeContract 569private class CollectionDataContractCriticalHelper : DataContract.DataContractCriticalHelper 578private DataContract _itemContract; 579private DataContract _sharedTypeContract; 631throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType)))); 632itemName = DataContract.EncodeLocalName(collectionContractAttribute.ItemName); 638throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType)))); 640throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName))); 641keyName = DataContract.EncodeLocalName(collectionContractAttribute.KeyName); 646throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType)))); 648throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName))); 649valueName = DataContract.EncodeLocalName(collectionContractAttribute.ValueName); 656_itemName = itemName ?? DataContract.GetStableName(DataContract.UnwrapNullableType(itemType)).Name; 683this.StableName = DataContract.GetStableName(type); 691throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.CollectionMustHaveGetEnumeratorMethod, DataContract.GetClrTypeFullName(type)))); 693throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(type)))); 695throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.CollectionMustHaveItemType, DataContract.GetClrTypeFullName(type)))); 698this.StableName = DataContract.GetCollectionStableName(type, itemType, out collectionContractAttribute); 730internal DataContract ItemContract 740DataContract.ThrowInvalidDataContractException( 741string.Format(SRSerialization.DupKeyValueName, DataContract.GetClrTypeFullName(UnderlyingType), KeyName), 746DataContract.GetDataContract(ItemType); 753_itemContract = DataContract.GetDataContract(ItemType); 765internal DataContract SharedTypeContract 843_knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 885private DataContract GetSharedTypeContract(Type type) 924if (type.IsArray && DataContract.GetBuiltInDataContract(type) == null) 929DataContract dataContract; 933internal static bool TryCreate(Type type, out DataContract dataContract) 939internal static bool CreateGetOnlyCollectionDataContract(Type type, out DataContract dataContract) 953internal static bool TryCreateGetOnlyCollectionDataContract(Type type, out DataContract dataContract) 993private static bool IsCollectionOrTryCreate(Type type, bool tryCreate, out DataContract dataContract, out Type itemType, bool constructorRequired) 998if (DataContract.GetBuiltInDataContract(type) != null) 1137SRSerialization.CollectionTypeDoesNotHaveAddMethod, DataContract.GetClrTypeFullName(itemType), ref dataContract); 1194private static bool HandleIfInvalidCollection(Type type, bool tryCreate, bool hasCollectionDataContract, bool createContractWithException, string message, string param, ref DataContract dataContract) 1199throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(GetInvalidCollectionMessage(message, string.Format(SRSerialization.InvalidCollectionDataContract, DataContract.GetClrTypeFullName(type)), param))); 1206dataContract = new CollectionDataContract(type, GetInvalidCollectionMessage(message, string.Format(SRSerialization.InvalidCollectionType, DataContract.GetClrTypeFullName(type)), param)); 1289internal override DataContract GetValidContract(SerializationMode mode) 1297internal override DataContract GetValidContract() 1314throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(this.UnderlyingType)))); 1341DataContract.GetClrTypeFullName(UnderlyingType)), 1353DataContract.GetClrTypeFullName(ItemType)), 1365DataContract.GetClrTypeFullName(UnderlyingType)), 1377DataContract.GetClrTypeFullName(UnderlyingType), 1401DataContract.GetClrTypeFullName(UnderlyingType)), 1413DataContract.GetClrTypeFullName(ItemType)),
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (103)
14using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 109internal static DataContract GetDataContract(Type type) 114internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 119internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 122DataContract dataContract = GetDataContractSkipValidation(id, typeHandle, null); 126internal static DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle, SerializationMode mode) 128DataContract dataContract = GetDataContractSkipValidation(id, typeHandle, null); 137internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 142internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 144DataContract dataContract = GetGetOnlyCollectionDataContractSkipValidation(id, typeHandle, type); 148throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(string.Format(SRSerialization.ErrorDeserializing, string.Format(SRSerialization.ErrorTypeInfo, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), string.Format(SRSerialization.NoSetMethodForProperty, string.Empty, string.Empty)))); 158internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 168internal static DataContract GetDataContractForInitialization(int id) 198public static DataContract GetBuiltInDataContract(Type type) 208public static DataContract GetBuiltInDataContract(string name, string ns) 309throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 314throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 499internal virtual DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts) 504internal virtual DataContract GetValidContract(SerializationMode mode) 509internal virtual DataContract GetValidContract() 527private static DataContract[] s_dataContractCache; 529private static Dictionary<Type, DataContract> s_typeToBuiltInContract; 530private static Dictionary<XmlQualifiedName, DataContract> s_nameToBuiltInContract; 563s_dataContractCache = new DataContract[32]; 567internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 575DataContract dataContract = s_dataContractCache[id]; 588internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 596DataContract dataContract = s_dataContractCache[id]; 605internal static DataContract GetDataContractForInitialization(int id) 607DataContract dataContract = s_dataContractCache[id]; 617int id = DataContract.GetId(classContract.TypeForInitialization.TypeHandle); 633private static bool ContractMatches(DataContract contract, DataContract cachedContract) 656Array.Resize<DataContract>(ref s_dataContractCache, newSize); 677private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 679DataContract dataContract = s_dataContractCache[id]; 745private static void AssignDataContractToId(DataContract dataContract, int id) 760private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 762DataContract dataContract = null; 808public static DataContract GetBuiltInDataContract(Type type) 816s_typeToBuiltInContract = new Dictionary<Type, DataContract>(); 818DataContract dataContract = null; 828public static DataContract GetBuiltInDataContract(string name, string ns) 833s_nameToBuiltInContract = new Dictionary<XmlQualifiedName, DataContract>(); 835DataContract dataContract = null; 846static public bool TryCreateBuiltInDataContract(Type type, out DataContract dataContract) 944static public bool TryCreateBuiltInDataContract(string name, string ns, out DataContract dataContract) 1309return DataContract.GetBuiltInDataContract(type) != null || 1452throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidDataContractName, DataContract.GetClrTypeFullName(type)))); 1455name = DataContract.EncodeLocalName(name); 1464throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidDataContractNamespace, DataContract.GetClrTypeFullName(type)))); 1502DataContract builtInContract = GetBuiltInDataContract(type); 1543throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.TooManyDataContracts, DataContract.GetClrTypeFullName(type)))); 1585throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.TooManyCollectionContracts, DataContract.GetClrTypeFullName(type)))); 1592throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractName, DataContract.GetClrTypeFullName(type)))); 1595name = DataContract.EncodeLocalName(name); 1604throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidCollectionContractNamespace, DataContract.GetClrTypeFullName(type)))); 1626if (DataContract.GetBuiltInDataContract(itemType) != null) 1639GenericInfo genericInfo = new GenericInfo(DataContract.GetStableName(Globals.TypeOfNullable), Globals.TypeOfNullable.FullName); 1676typeName = DataContract.GetClrTypeFullName(type).Substring(nsLen).Replace('+', '.'); 1698XmlQualifiedName qname = DataContract.GetStableName(genParam); 1715return DataContract.EncodeLocalName(typeName); 2070while (type != null && DataContract.IsTypeSerializable(type)) 2088DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeOneScheme, DataContract.GetClrTypeFullName(type)), type); 2098DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeOneScheme, DataContract.GetClrTypeFullName(type)), type); 2104DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeNoData, DataContract.GetClrTypeFullName(type)), type); 2108DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeEmptyString, DataContract.GetClrTypeFullName(type)), type); 2112DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeUnknownMethod, methodName, DataContract.GetClrTypeFullName(type)), type); 2115DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeReturnType, DataContract.GetClrTypeFullName(type), methodName), type); 2120DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeMethodNull, DataContract.GetClrTypeFullName(type)), type); 2126DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.KnownTypeAttributeValidMethodTypes, DataContract.GetClrTypeFullName(type)), type); 2140CollectionDataContract collectionDataContract = DataContract.GetDataContract(type) as CollectionDataContract; 2144DataContract itemDataContract = DataContract.GetDataContract(Globals.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GetGenericArguments())); 2170type = DataContract.UnwrapNullableType(type); 2171DataContract dataContract = DataContract.GetDataContract(type); 2172DataContract alreadyExistingContract; 2198DataContract dataContract = other as DataContract; 2270return (type.GetTypeInfo().Module.Equals(typeof(DataContract).GetTypeInfo().Module) || IsAssemblyFriendOfSerialization(type.GetTypeInfo().Assembly)) && !type.GetTypeInfo().IsNestedPrivate; 2347: this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments()) 2358DataContract.GetClrNameAndNamespace(genericTypeName, out name, out ns); 2359_nestedParamCounts = DataContract.GetDataContractNameForGenericName(name, null); 2398parametersFromBuiltInNamespaces = DataContract.IsBuiltInNamespace(GetStableName(j).Namespace); 2414_genericParams[i] = qname = DataContract.GetStableName(paramType); 2416_genericParams[i] = qname = ((DataContract)o).StableName; 2461return new XmlQualifiedName(DataContract.EncodeLocalName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(_stableName.Name), this)), _stableName.Namespace); 2515parametersFromBuiltInNamespaces = DataContract.IsBuiltInNamespace(_paramGenericInfos[j].GetStableNamespace());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSerializer.cs (11)
18using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 23private DataContract _rootContract; // post-surrogate 56Initialize(type, dictionary.Add(rootName), dictionary.Add(DataContract.GetNamespace(rootNamespace)), knownTypes, int.MaxValue, false, false, null, false); 210private DataContract RootContract 216_rootContract = DataContract.GetDataContract((_serializationSurrogateProvider == null) ? _rootType : GetSurrogatedType(_serializationSurrogateProvider, _rootType)); 310DataContract contract = RootContract; 365internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 377return DataContract.GetDataContract(objectType.TypeHandle, objectType, SerializationMode.SharedContract); 430DataContract contract = RootContract; 473return DataContractSurrogateCaller.GetDataContractType(serializationSurrogateProvider, DataContract.UnwrapNullableType(type));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (49)
13using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 17private Dictionary<XmlQualifiedName, DataContract> _contracts; 18private Dictionary<DataContract, object> _processedContracts; 43foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet) 50foreach (KeyValuePair<DataContract, object> pair in dataContractSet._processedContracts) 57private Dictionary<XmlQualifiedName, DataContract> Contracts 63_contracts = new Dictionary<XmlQualifiedName, DataContract>(); 69private Dictionary<DataContract, object> ProcessedContracts 75_processedContracts = new Dictionary<DataContract, object>(); 99DataContract dataContract = GetDataContract(type); 110private void Add(DataContract dataContract) 115public void Add(XmlQualifiedName name, DataContract dataContract) 122internal void InternalAdd(XmlQualifiedName name, DataContract dataContract) 124DataContract dataContractInSet = null; 133bool typeNamesEqual = (DataContract.GetClrTypeFullName(dataContract.UnderlyingType) == DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)); 134throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRSerialization.DupTypeContractInDataContractSet, (typeNamesEqual ? dataContract.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), (typeNamesEqual ? dataContractInSet.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)), dataContract.StableName.Name, dataContract.StableName.Namespace))); 170DataContract memberDataContract = GetMemberTypeDataContract(dataMember); 196DataContract itemContract = GetItemTypeDataContract(collectionDataContract); 212foreach (DataContract knownDataContract in knownDataContracts.Values) 227return DataContract.GetStableName(dcType); 229return DataContract.GetStableName(clrType); 232internal DataContract GetDataContract(Type clrType) 235return DataContract.GetDataContract(clrType); 236DataContract dataContract = DataContract.GetBuiltInDataContract(clrType); 242dataContract = DataContract.GetDataContract(dcType); 253internal DataContract GetMemberTypeDataContract(DataMember dataMember) 266DataContract.GetClrTypeFullName(dataMemberType), DataContract.GetClrTypeFullName(dataMember.MemberInfo.DeclaringType), dataMember.MemberInfo.Name))); 269return DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(dataMemberType.TypeHandle), dataMemberType.TypeHandle, dataMemberType, SerializationMode.SharedContract); 279internal DataContract GetItemTypeDataContract(CollectionDataContract collectionContract) 296public DataContract this[XmlQualifiedName key] 300DataContract dataContract = DataContract.GetBuiltInDataContract(key.Name, key.Namespace); 316if (DataContract.GetBuiltInDataContract(key.Name, key.Namespace) != null) 321public IEnumerator<KeyValuePair<XmlQualifiedName, DataContract>> GetEnumerator() 326internal bool IsContractProcessed(DataContract dataContract) 331internal void SetContractProcessed(DataContract dataContract) 336internal ContractCodeDomInfo GetContractCodeDomInfo(DataContract dataContract) 344internal void SetContractCodeDomInfo(DataContract dataContract, ContractCodeDomInfo info) 355_referencedTypesDictionary.Add(DataContract.GetStableName(Globals.TypeOfNullable), Globals.TypeOfNullable); 384XmlQualifiedName genericDictionaryName = DataContract.GetStableName(Globals.TypeOfDictionaryGeneric); 438internal bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 443internal bool TryGetReferencedCollectionType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 448private bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, bool useReferencedCollectionTypes, out Type type) 471DataContract other = this.GetDataContract(conflictingType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSurrogateCaller.cs (6)
16if (DataContract.GetBuiltInDataContract(type) != null) 26if (DataContract.GetBuiltInDataContract(type) != null) 35if (DataContract.GetBuiltInDataContract(objType) != null) 44if (DataContract.GetBuiltInDataContract(objType) != null) 56if (DataContract.GetBuiltInDataContract(clrType) != null) 68if (DataContract.GetBuiltInDataContract(typeName, typeNamespace) != null)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMember.cs (14)
66internal DataMember(DataContract memberTypeContract, string name, bool isNullable, bool isRequired, bool emitDefaultValue, int order) 145internal DataContract MemberTypeContract 178private DataContract _memberTypeContract; 205internal CriticalHelper(DataContract memberTypeContract, string name, bool isNullable, bool isRequired, bool emitDefaultValue, int order) 267internal DataContract MemberTypeContract 277_memberTypeContract = DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(MemberType.TypeHandle), MemberType.TypeHandle, MemberType, SerializationMode.SharedContract); 281_memberTypeContract = DataContract.GetDataContract(MemberType); 317return DataContract.FieldRequiresMemberAccess(field); 325return DataContract.MethodRequiresMemberAccess(getMethod) || !DataContract.IsTypeVisible(property.PropertyType); 342return DataContract.FieldRequiresMemberAccess(field); 350return DataContract.MethodRequiresMemberAccess(setMethod) || !DataContract.IsTypeVisible(property.PropertyType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (11)
145private class EnumDataContractCriticalHelper : DataContract.DataContractCriticalHelper 193this.StableName = DataContract.GetStableName(type, out _hasDataContract); 210DataContract.ThrowInvalidDataContractException( 212DataContract.GetClrTypeFullName(type), 289ThrowInvalidDataContractException(string.Format(SRSerialization.TooManyEnumMembers, DataContract.GetClrTypeFullName(field.DeclaringType), field.Name)); 296ThrowInvalidDataContractException(string.Format(SRSerialization.InvalidEnumMemberValue, field.Name, DataContract.GetClrTypeFullName(type))); 307ThrowInvalidDataContractException(string.Format(SRSerialization.DataMemberOnEnumField, DataContract.GetClrTypeFullName(field.DeclaringType), field.Name)); 371throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)))); 377throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)))); 417throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.InvalidEnumValueOnRead, stringValue, DataContract.GetClrTypeFullName(UnderlyingType)))); 436throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (17)
77public override Dictionary<XmlQualifiedName, DataContract> KnownDataContracts //inherited as internal 104private class ExceptionDataContractCriticalHelper : DataContract.DataContractCriticalHelper 113private Dictionary<XmlQualifiedName, DataContract> _knownDataContracts; 152this.StableName = DataContract.GetStableName(type, out _hasDataContract); 158DataContract baseContract = DataContract.GetDataContract(baseType); 206internal override Dictionary<XmlQualifiedName, DataContract> KnownDataContracts // inherited as internal 212_knownDataContracts = new Dictionary<XmlQualifiedName, DataContract>(); 284memberContract.Name = DataContract.EncodeLocalName(member.Name); 286memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 318memberContract.Name = DataContract.EncodeLocalName(member.Name); 320memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 330DataContract dataDataContract = GetDataContract(typeof(IDictionary<object, object>)); 373DataContract propDataContract = context.GetDataContract(prop.PropertyType); 417DataContract fieldDataContract = context.GetDataContract(fieldType); 454DataContract.ThrowInvalidDataContractException( 458DataContract.GetClrTypeFullName(declaringType),
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\GenericParameterDataContract.cs (6)
38private class GenericParameterDataContractCriticalHelper : DataContract.DataContractCriticalHelper 45SetDataContractName(DataContract.GetStableName(type)); 55internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract> boundContracts)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\KnownTypeDataContractResolver.cs (2)
39DataContract contract = DataContract.GetDataContract(type);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\PrimitiveDataContract.cs (3)
42return DataContract.GetBuiltInDataContract(type) as PrimitiveDataContract; 47return DataContract.GetBuiltInDataContract(name, ns) as PrimitiveDataContract; 174private class PrimitiveDataContractCriticalHelper : DataContract.DataContractCriticalHelper
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaExporter.cs (12)
24throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidXmlDataContractName, DataContract.GetClrTypeFullName(type)))); 39stableName = DataContract.GetDefaultStableName(clrType); 53throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidGetSchemaMethod, DataContract.GetClrTypeFullName(clrType)))); 54stableName = DataContract.GetDefaultStableName(clrType); 60throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName))); 63throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName)))); 70throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName))); 71stableName = DataContract.GetDefaultStableName(clrType); 77stableName = DataContract.GetDefaultStableName(clrType); 132typeName = new XmlQualifiedName(name, DataContract.GetDefaultStableNamespace(type));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (31)
17using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 186internal static bool IsObjectContract(DataContract dataContract) 228DataContract dataContract = ImportType(knownType); 229DataContract existingContract; 358private DataContract ImportAnonymousGlobalElement(XmlSchemaElement element, XmlQualifiedName typeQName, string ns) 360DataContract contract = ImportAnonymousElement(element, typeQName); 370private DataContract ImportAnonymousElement(XmlSchemaElement element, XmlQualifiedName typeQName) 389private DataContract ImportType(XmlQualifiedName typeName) 391DataContract dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace); 404private DataContract ImportType(XmlSchemaType type) 410private DataContract ImportType(XmlSchemaType type, XmlQualifiedName typeName, bool isAnonymous) 412DataContract dataContract = _dataContractSet[typeName]; 560DataContract baseContract = ImportType(restriction.BaseType); 628private DataContract ImportType(XmlQualifiedName typeName, XmlSchemaParticle rootParticle, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlQualifiedName baseTypeName, XmlSchemaAnnotation annotation) 630DataContract dataContract = null; 704private DataContract ImportXmlDataType(XmlQualifiedName typeName, XmlSchemaType xsdType, bool isAnonymous) 706DataContract dataContract = _dataContractSet[typeName]; 762return (XmlDataContract)DataContract.GetBuiltInDataContract(Globals.TypeOfXmlElement); 765return (XmlDataContract)DataContract.GetBuiltInDataContract(Globals.TypeOfXmlNodeArray); 969DataContract memberTypeContract = null; 1084DataContract contract = _dataContractSet[shortName]; 1125GenericInfo genericInfo = new GenericInfo(DataContract.GetStableName(Globals.TypeOfKeyValue), Globals.TypeOfKeyValue.FullName); 1141genericInfo = new GenericInfo(DataContract.GetStableName(Globals.TypeOfNullable), Globals.TypeOfNullable.FullName); 1224private DataContract ImportSimpleTypeRestriction(XmlQualifiedName typeName, XmlSchemaSimpleTypeRestriction restriction) 1226DataContract dataContract = null; 1238private void ImportDataContractExtension(XmlSchemaType type, DataContract dataContract) 1266private void ImportGenericInfo(XmlSchemaType type, DataContract dataContract) 1301name = DataContract.EncodeLocalName(name); 1346DataContractSerializer serializer = new DataContractSerializer(Globals.TypeOfObject, dictionary.Add(name), dictionary.Add(DataContract.GetNamespace(ns)), knownTypes, 1412private void AddDataContract(DataContract dataContract)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ScopedKnownTypes.cs (3)
9using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 29internal DataContract GetDataContract(XmlQualifiedName qname) 34DataContract dataContract;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SpecialTypeDataContract.cs (1)
45private class SpecialTypeDataContractCriticalHelper : DataContract.DataContractCriticalHelper
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (11)
12using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 216private class XmlDataContractCriticalHelper : DataContract.DataContractCriticalHelper 235throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.IXmlSerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)))); 237throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.IXmlSerializableCannotHaveCollectionDataContract, DataContract.GetClrTypeFullName(type)))); 264_topLevelElementName = (elementName == null || elementName.Length == 0) ? Name : dictionary.Add(DataContract.EncodeLocalName(elementName)); 270throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.IsAnyCannotHaveXmlRoot, DataContract.GetClrTypeFullName(UnderlyingType)))); 286_knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 364throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.IXmlSerializableMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type)))); 395ilg.BeginMethod("Create" + DataContract.GetClrTypeFullName(type), typeof(CreateXmlSerializableDelegate), memberAccessFlag); 461new SecurityException(string.Format(SRSerialization.PartialTrustIXmlSerializableTypeNotPublic, DataContract.GetClrTypeFullName(UnderlyingType)), 472new SecurityException(string.Format(SRSerialization.PartialTrustIXmlSerialzableNoPublicConstructor, DataContract.GetClrTypeFullName(UnderlyingType)),
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (4)
847s_writeXmlValueMethod = typeof(DataContract).GetMethod("WriteXmlValue", Globals.ScanAllMembers); 863s_readXmlValueMethod = typeof(DataContract).GetMethod("ReadXmlValue", Globals.ScanAllMembers); 879s_namespaceProperty = typeof(DataContract).GetProperty("Namespace", Globals.ScanAllMembers); 1036s_throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(Type) });
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (8)
229_ilg.Call(null, XmlFormatGeneratorStatics.GetUninitializedObjectMethod, DataContract.GetIdForInitialization(classContract)); 395_ilg.Call(_contextArg, XmlFormatGeneratorStatics.ReadIfNullOrRefMethod, _xmlReaderArg, type, DataContract.IsTypeSerializable(type)); 405ThrowValidationException(string.Format(SRSerialization.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName(type))); 421ThrowValidationException(string.Format(SRSerialization.ValueTypeCannotHaveId, DataContract.GetClrTypeFullName(type))); 444ThrowValidationException(string.Format(SRSerialization.ValueTypeCannotHaveRef, DataContract.GetClrTypeFullName(type))); 474_ilg.Load(DataContract.GetId(declaredType.TypeHandle)); 771ClassDataContract keyValuePairContract = DataContract.GetDataContract(value.LocalType) as ClassDataContract; 870var type = DataContract.GetDataContractForInitialization(id).TypeForInitialization;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
150ClassDataContract dc = (ClassDataContract)DataContract.GetDataContract(objType); 578_ilg.Call(_contextArg, XmlFormatGeneratorStatics.WriteNullMethod, _xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 604_ilg.Call(_contextArg, XmlFormatGeneratorStatics.WriteNullMethod, _xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 628_ilg.Load(DataContract.GetId(memberType.TypeHandle));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializer.cs (9)
15using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 175internal void WriteRootElement(XmlWriterDelegator writer, DataContract contract, XmlDictionaryString name, XmlDictionaryString ns, bool needsContractNsAtRoot) 193internal bool CheckIfNeedsContractNsAtRoot(XmlDictionaryString name, XmlDictionaryString ns, DataContract contract) 215internal static bool IsContractDeclared(DataContract contract, DataContract declaredContract) 309internal bool IsRootXmlAny(XmlDictionaryString rootName, DataContract contract) 319internal bool IsRootElement(XmlReaderDelegator reader, DataContract contract, XmlDictionaryString name, XmlDictionaryString ns) 345DataContract objectContract = PrimitiveDataContract.GetPrimitiveDataContract(Globals.TypeOfObject); 383string typeInfo = (type == null) ? string.Empty : string.Format(SRSerialization.ErrorTypeInfo, DataContract.GetClrTypeFullName(type));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerContext.cs (29)
13using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 22protected DataContract rootTypeDataContract; 50internal XmlObjectSerializerContext(DataContractSerializer serializer, DataContract rootTypeDataContract 125internal DataContract GetDataContract(Type type) 130internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 134return DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(typeHandle), typeHandle, type, Mode); 138return DataContract.GetDataContract(typeHandle, type, Mode); 142internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 146return DataContract.GetGetOnlyCollectionDataContractSkipValidation(typeId, typeHandle, type); 150return DataContract.GetDataContractSkipValidation(typeId, typeHandle, type); 155internal virtual DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 159return DataContract.GetGetOnlyCollectionDataContract(id, typeHandle, null /*type*/, Mode); 163return DataContract.GetDataContract(id, typeHandle, Mode); 191private DataContract GetDataContractFromSerializerKnownTypes(XmlQualifiedName qname) 196DataContract outDataContract; 211DataContract.CheckAndAdd(knownType, typesChecked, ref dataContracts); 216internal bool IsKnownType(DataContract dataContract, DataContractDictionary knownDataContracts, Type declaredType) 234internal bool IsKnownType(DataContract dataContract, Type declaredType) 236DataContract knownContract = ResolveDataContractFromKnownTypes(dataContract.StableName.Name, dataContract.StableName.Namespace, null /*memberTypeContract*/ /*, declaredType */); 242DataContract dataContract = ResolveDataContractFromKnownTypes(typeName); 246private DataContract ResolveDataContractFromKnownTypes(XmlQualifiedName typeName) 248DataContract dataContract = PrimitiveDataContract.GetPrimitiveDataContract(typeName.Name, typeName.Namespace); 266protected DataContract ResolveDataContractFromKnownTypes(string typeName, string typeNs, DataContract memberTypeContract) 269DataContract dataContract; 296DataContract itemContract = GetDataContract(GetSurrogatedType(collectionContract.ItemType)); 310internal void PushKnownTypes(DataContract dc) 318internal void PopKnownTypes(DataContract dc)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (15)
15using DataContractDictionary = System.Collections.Generic.Dictionary<Microsoft.Xml.XmlQualifiedName, DataContract>; 72throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.NullValueReturnedForGetOnlyCollection, DataContract.GetClrTypeFullName(type)))); 81throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ArrayExceededSize, arraySize, DataContract.GetClrTypeFullName(type)))); 84internal static XmlObjectSerializerReadContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 96internal XmlObjectSerializerReadContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 109DataContract dataContract = GetDataContract(id, declaredTypeHandle); 115DataContract dataContract = GetDataContract(declaredType); 119internal virtual object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, string name, string ns) 134throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ErrorDeserializing, string.Format(SRSerialization.ErrorTypeInfo, DataContract.GetClrTypeFullName(declaredType)), string.Format(SRSerialization.XmlStartElementExpected, Globals.RefLocalName)))); 151protected object InternalDeserialize(XmlReaderDelegator reader, string name, string ns, ref DataContract dataContract) 423throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.FactoryObjectContainsSelfReference, DataContract.GetClrTypeFullName(oldObj.GetType()), DataContract.GetClrTypeFullName(newObj.GetType()), id))); 475DataContract.GetClrTypeFullName(typeof(T))))); 561protected virtual DataContract ResolveDataContractFromTypeName() 586protected virtual object ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (11)
19internal XmlObjectSerializerReadContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 67internal override object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, string name, string ns) 88DataContract dataContract; 120private object InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, string name, string ns) 122DataContract dataContract = surrogateDataContract ?? 126throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser, DataContract.GetClrTypeFullName(declaredType)))); 142private DataContract ResolveDataContractInSharedTypeMode(string assemblyName, string typeName, out Assembly assembly, out Type type) 153protected override DataContract ResolveDataContractFromTypeName() 178if (!DataContract.IsTypeSerializable(memberType)) 194type = DataContract.UnwrapNullableType(type); 199DataContract.GetClrTypeFullName(type))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (26)
37internal static XmlObjectSerializerWriteContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 44protected XmlObjectSerializerWriteContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver resolver) 122DataContract contract = GetDataContract(declaredTypeID, declaredTypeHandle); 130DataContract dataContract = (declaredTypeID >= 0) 142internal void SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 158internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 181DataContract dataContract; 184dataContract = GetDataContractSkipValidation(DataContract.GetId(objectTypeHandle), objectTypeHandle, objectType); 223DataContract declaredTypeContract = (declaredTypeID >= 0) 233internal bool OnHandleIsReference(XmlWriterDelegator xmlWriter, DataContract contract, object obj) 256protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 270DataContract knownContract = ResolveDataContractFromKnownTypes(dataContract.StableName.Name, dataContract.StableName.Namespace, null /*memberTypeContract*/); 273throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.StableName.Name, dataContract.StableName.Namespace))); 286internal virtual bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 409internal void HandleGraphAtTopLevel(XmlWriterDelegator writer, object obj, DataContract contract) 422throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.CannotSerializeObjectWithCycles, DataContract.GetClrTypeFullName(obj.GetType())))); 571throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.UnknownXmlType, DataContract.GetClrTypeFullName(obj.GetType())))); 579protected virtual void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 602throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ResolveTypeReturnedFalse, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 612throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 617throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 622protected virtual bool WriteTypeInfo(XmlWriterDelegator writer, DataContract contract, DataContract declaredContract)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (6)
28internal XmlObjectSerializerWriteContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver dataContractResolver) 46internal override bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 221if (!DataContract.IsTypeSerializable(memberType)) 237type = DataContract.UnwrapNullableType(type); 242DataContract.GetClrTypeFullName(type)))); 273DataContract contract = GetDataContract(objTypeHandle, objType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlSerializableWriter.cs (3)
27throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IXmlSerializableMissingEndElements, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType()))))); 56throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType()))))); 64throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType())))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (1)
289return new InvalidDataContractException(string.Format(SRSerialization.InvalidPrimitiveType, DataContract.GetClrTypeFullName(type)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XsdDataContractImporter.cs (7)
162DataContract dataContract = FindDataContract(typeName); 173DataContract dataContract = FindDataContract(typeName); 179internal DataContract FindDataContract(XmlQualifiedName typeName) 184DataContract dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace); 199DataContract dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace);