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