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