756 references to Globals
System.Private.DataContractSerialization (756)
System\Runtime\Serialization\Attributes.cs (2)
88
Id =
Globals
.NewObjectId;
89
Ref =
Globals
.NewObjectId;
System\Runtime\Serialization\BitFlagsGenerator.cs (1)
71
LocalBuilder localArray = _ilg.DeclareLocal(
Globals
.TypeOfByteArray);
System\Runtime\Serialization\ClassDataContract.cs (35)
166
if (ci == null || UnderlyingType ==
Globals
.TypeOfSchemaDefinedType)
189
Debug.Assert(UnderlyingType !=
Globals
.TypeOfSchemaDefinedType);
219
Debug.Assert(UnderlyingType !=
Globals
.TypeOfSchemaDefinedType);
278
if (!childType.IsEnum && !
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(childType)
279
&& DataContract.GetBuiltInDataContract(childType) == null && childType !=
Globals
.TypeOfDBNull)
313
if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
319
if (type.IsDefined(
Globals
.TypeOfCollectionDataContractAttribute, false))
336
if (
Globals
.TypeOfISerializable.IsAssignableFrom(type))
339
if (type.IsDefined(
Globals
.TypeOfDataContractAttribute, false))
342
if (type ==
Globals
.TypeOfExtensionDataObject)
622
if (type ==
Globals
.TypeOfDBNull)
634
IsISerializable = (
Globals
.TypeOfISerializable.IsAssignableFrom(type));
641
if (baseType != null && !(baseType.IsSerializable &&
Globals
.TypeOfISerializable.IsAssignableFrom(baseType)))
646
if (baseType != null && baseType !=
Globals
.TypeOfObject && baseType !=
Globals
.TypeOfValueType && baseType !=
Globals
.TypeOfUri)
669
_hasExtensionData = (
Globals
.TypeOfIExtensibleDataObject.IsAssignableFrom(type));
913
if (_hasExtensionData && memberContract.MemberType ==
Globals
.TypeOfExtensionDataObject
914
&& member.Name ==
Globals
.ExtensionDataObjectPropertyName)
933
object[] optionalFields = field!.GetCustomAttributes(
Globals
.TypeOfOptionalFieldAttribute, false);
1080
if (method.Name ==
Globals
.ExtensionDataSetExplicitMethod || !method.IsPublic)
1085
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnSerializingAttribute, _onSerializing, ref prevAttributeType))
1087
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnSerializedAttribute, _onSerialized, ref prevAttributeType))
1089
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnDeserializingAttribute, _onDeserializing, ref prevAttributeType))
1091
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnDeserializedAttribute, _onDeserialized, ref prevAttributeType))
1103
if (method.Name ==
Globals
.ExtensionDataSetExplicitMethod || method.Name ==
Globals
.ExtensionDataSetMethod)
1109
if (method.ReturnType !=
Globals
.TypeOfVoid)
1111
if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType !=
Globals
.TypeOfExtensionDataObject)
1112
DataContract.ThrowInvalidDataContractException(SR.Format(SR.ExtensionDataSetParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method,
Globals
.TypeOfExtensionDataObject), method.DeclaringType);
1132
if (method.ReturnType !=
Globals
.TypeOfVoid)
1134
if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType !=
Globals
.TypeOfStreamingContext)
1135
DataContract.ThrowInvalidDataContractException(SR.Format(SR.CallbackParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method,
Globals
.TypeOfStreamingContext), method.DeclaringType);
1248
ConstructorInfo? ctor = UnderlyingType.GetConstructor(
Globals
.ScanAllMembers, SerInfoCtorArgs);
1507
type =
Globals
.TypeOfValueType;
System\Runtime\Serialization\CodeGenerator.cs (4)
323
ConvertValue(type,
Globals
.TypeOfObject);
325
ConvertValue(type,
Globals
.TypeOfObject);
546
if (arrayType ==
Globals
.TypeOfArray)
1307
if (type !=
Globals
.TypeOfString)
System\Runtime\Serialization\CollectionDataContract.cs (65)
432
Globals
.TypeOfIDictionaryGeneric,
433
Globals
.TypeOfIDictionary,
434
Globals
.TypeOfIListGeneric,
435
Globals
.TypeOfICollectionGeneric,
436
Globals
.TypeOfIList,
437
Globals
.TypeOfIEnumerableGeneric,
438
Globals
.TypeOfICollection,
439
Globals
.TypeOfIEnumerable
488
_keyName = keyName ??
Globals
.KeyLocalName;
489
_valueName = valueName ??
Globals
.ValueLocalName;
504
if (type ==
Globals
.TypeOfArray)
505
type =
Globals
.TypeOfObjectArray;
533
XmlName = CreateQualifiedName(
Globals
.ArrayPrefix + itemContract.XmlName.Name, itemContract.XmlName.Namespace);
798
s_buildIncrementCollectionCountDelegateMethod ??= typeof(CollectionDataContractCriticalHelper).GetMethod(nameof(BuildIncrementCollectionCountDelegate),
Globals
.ScanAllMembers)!;
850
enumeratorType =
Globals
.TypeOfGenericDictionaryEnumerator.MakeGenericType(keyValueTypes);
854
enumeratorType =
Globals
.TypeOfDictionaryEnumerator;
861
MethodInfo? getCurrentMethod = enumeratorType.GetMethod(
Globals
.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
870
Type ienumeratorInterface =
Globals
.TypeOfIEnumerator;
877
&& interfaceType.GetGenericTypeDefinition() ==
Globals
.TypeOfIEnumeratorGeneric
886
getCurrentMethod = GetTargetMethodWithName(
Globals
.GetCurrentMethodName, enumeratorType, ienumeratorInterface)!;
897
s_buildCreateGenericDictionaryEnumerator ??= typeof(CollectionDataContractCriticalHelper).GetMethod(nameof(BuildCreateGenericDictionaryEnumerator),
Globals
.ScanAllMembers)!;
912
if (type.IsDefined(
Globals
.TypeOfCollectionDataContractAttribute, false))
917
if (type.IsSerializable || type.IsDefined(
Globals
.TypeOfDataContractAttribute, false))
1010
itemType =
Globals
.TypeOfObject;
1024
bool isBaseTypeCollection = (baseType != null && baseType !=
Globals
.TypeOfObject
1025
&& baseType !=
Globals
.TypeOfValueType && baseType !=
Globals
.TypeOfUri) ? IsCollection(baseType) : false;
1032
if (type.IsDefined(
Globals
.TypeOfDataContractAttribute, false))
1038
if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type) || IsArraySegment(type))
1043
if (!
Globals
.TypeOfIEnumerable.IsAssignableFrom(type))
1061
if (interfaceTypeToCheck ==
Globals
.TypeOfIDictionaryGeneric)
1063
itemType =
Globals
.TypeOfKeyValue.MakeGenericType(genericArgs);
1064
addMethod = type.GetMethod(
Globals
.AddMethodName);
1065
getEnumeratorMethod =
Globals
.TypeOfIEnumerableGeneric.MakeGenericType(
Globals
.TypeOfKeyValuePair.MakeGenericType(genericArgs)).GetMethod(
Globals
.GetEnumeratorMethodName)!;
1070
if (interfaceTypeToCheck ==
Globals
.TypeOfICollectionGeneric || interfaceTypeToCheck ==
Globals
.TypeOfIListGeneric)
1072
addMethod =
Globals
.TypeOfICollectionGeneric.MakeGenericType(itemType).GetMethod(
Globals
.AddMethodName);
1074
getEnumeratorMethod =
Globals
.TypeOfIEnumerableGeneric.MakeGenericType(itemType).GetMethod(
Globals
.GetEnumeratorMethodName)!;
1079
if (interfaceTypeToCheck ==
Globals
.TypeOfIDictionary)
1082
addMethod = type.GetMethod(
Globals
.AddMethodName);
1086
itemType =
Globals
.TypeOfObject;
1089
if (interfaceTypeToCheck ==
Globals
.TypeOfIList)
1091
addMethod = type.GetMethod(
Globals
.AddMethodName);
1095
getEnumeratorMethod = typeof(IEnumerable).GetMethod(
Globals
.GetEnumeratorMethodName)!;
1163
knownInterfaceType =
Globals
.TypeOfIEnumerable;
1164
itemType = knownInterfaceType.IsGenericType ? knownInterfaceType.GetGenericArguments()[0] :
Globals
.TypeOfObject;
1211
itemType = isOpenGeneric ?
Globals
.TypeOfKeyValue :
Globals
.TypeOfKeyValue.MakeGenericType(addMethodTypeArray);
1214
addMethodTypeArray = new Type[] {
Globals
.TypeOfObject,
Globals
.TypeOfObject };
1215
itemType =
Globals
.TypeOfKeyValue.MakeGenericType(addMethodTypeArray);
1223
itemType =
Globals
.TypeOfObject;
1248
return type.IsDefined(
Globals
.TypeOfCollectionDataContractAttribute, false);
1296
addMethod = t.GetMethod(
Globals
.AddMethodName) ?? addMethod;
1297
getEnumeratorMethod = t.GetMethod(
Globals
.GetEnumeratorMethodName) ?? getEnumeratorMethod;
1313
addMethod = type.GetMethod(
Globals
.AddMethodName, BindingFlags.Instance | BindingFlags.Public, addMethodTypeArray);
1341
addMethod = type.GetMethod(
Globals
.AddMethodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, addMethodTypeArray);
1346
getEnumeratorMethod = type.GetMethod(
Globals
.GetEnumeratorMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
1347
if (getEnumeratorMethod == null || !
Globals
.TypeOfIEnumerator.IsAssignableFrom(getEnumeratorMethod.ReturnType))
1351
Globals
.TypeOfIEnumerable;
1362
=> GetTargetMethodWithName(
Globals
.GetEnumeratorMethodName, type, ienumerableInterface);
System\Runtime\Serialization\DataContract.cs (50)
277
writer.WriteStartElement(
Globals
.SerPrefix, name, ns);
465
else if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
470
type =
Globals
.TypeOfReflectionPointer;
475
if (!type.IsSerializable && !type.IsDefined(
Globals
.TypeOfDataContractAttribute, false) && !ClassDataContract.IsNonAttributedTypeValidForSerialization(type))
538
if (type ==
Globals
.TypeOfDateTimeOffset)
540
return
Globals
.TypeOfDateTimeOffsetAdapter;
542
if (type ==
Globals
.TypeOfMemoryStream)
544
return
Globals
.TypeOfMemoryStreamAdapter;
553
if (type ==
Globals
.TypeOfDateTimeOffsetAdapter)
555
return
Globals
.TypeOfDateTimeOffset;
557
if (type ==
Globals
.TypeOfMemoryStreamAdapter)
559
return
Globals
.TypeOfMemoryStream;
565
if (
Globals
.TypeOfDateTimeOffset.TypeHandle.Equals(typeHandle))
567
return
Globals
.TypeOfDateTimeOffsetAdapter.TypeHandle;
569
if (
Globals
.TypeOfMemoryStream.TypeHandle.Equals(typeHandle))
571
return
Globals
.TypeOfMemoryStreamAdapter.TypeHandle;
581
type =
Globals
.TypeOfObject;
860
else if (ns ==
Globals
.DataContractXmlNamespace)
906
s_clrTypeStrings.Add(
Globals
.TypeOfInt.Assembly.FullName!, s_clrTypeStringsDictionary.Add(
Globals
.MscorlibAssemblyName));
1050
MethodInfo? method = UnderlyingType.GetMethod(
Globals
.ParseMethodName, BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(string) });
1101
type.IsDefined(
Globals
.TypeOfDataContractAttribute, false) ||
1105
type ==
Globals
.TypeOfDBNull ||
1106
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
1164
while (type.IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
1174
while (type.IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
1324
else if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
1342
object[] dataContractAttributes = type.GetCustomAttributes(
Globals
.TypeOfDataContractAttribute, false).ToArray();
1367
object[] collectionContractAttributes = type.GetCustomAttributes(
Globals
.TypeOfCollectionDataContractAttribute, false).ToArray();
1400
string arrayOfPrefix =
Globals
.ArrayPrefix + GetArrayPrefix(ref itemType);
1417
arrayOfPrefix +=
Globals
.ArrayPrefix;
1425
return IsBuiltInNamespace(elementNs) ?
Globals
.CollectionsNamespace : elementNs;
1435
GenericInfo genericInfo = new GenericInfo(DataContract.GetXmlName(
Globals
.TypeOfNullable),
Globals
.TypeOfNullable.FullName!);
1445
string name =
Globals
.ArrayPrefix + itemName.Name;
1568
return (ns ==
Globals
.SchemaNamespace || ns ==
Globals
.SerializationNamespace);
1585
return new Uri(
Globals
.DataContractXsdBaseNamespaceUri, clrNs ?? string.Empty).AbsoluteUri;
1659
Span<char> formatted = stackalloc char[
Globals
.SerializationNamespace.Length];
1661
charsWritten ==
Globals
.SerializationNamespace.Length &&
1662
formatted.SequenceEqual(
Globals
.SerializationNamespace))
1664
ThrowInvalidDataContractException(SR.Format(SR.DataContractNamespaceReserved,
Globals
.SerializationNamespace), type);
1698
return uriString.StartsWith(
Globals
.DataContractXsdBaseNamespace, StringComparison.Ordinal) ? uriString.Substring(
Globals
.DataContractXsdBaseNamespace.Length) : uriString;
1927
type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable);
1950
object[] knownTypeAttributes = type.GetCustomAttributes(
Globals
.TypeOfKnownTypeAttribute, false).ToArray();
1988
if (!
Globals
.TypeOfTypeEnumerable.IsAssignableFrom(method.ReturnType))
2025
collectionDataContract.ItemType.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValue)
2027
DataContract itemDataContract = DataContract.GetDataContract(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GetGenericArguments()));
2237
Globals
.FullSRSInternalsVisibleRegex.IsMatch(internalsVisibleAttributeAssemblyName))
System\Runtime\Serialization\DataContractSerializer.cs (1)
531
objType = obj != null ? obj.GetType() :
Globals
.TypeOfObject;
System\Runtime\Serialization\DataContractSet.cs (8)
177
if (collectionDataContract.UnderlyingType !=
Globals
.TypeOfSchemaDefinedType)
321
_referencedTypesDictionary.Add(DataContract.GetXmlName(
Globals
.TypeOfNullable),
Globals
.TypeOfNullable);
352
XmlQualifiedName genericDictionaryName = DataContract.GetXmlName(
Globals
.TypeOfDictionaryGeneric);
354
AddReferencedType(_referencedCollectionTypesDictionary,
Globals
.TypeOfDictionaryGeneric);
416
type.IsDefined(
Globals
.TypeOfDataContractAttribute, false) ||
417
(
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type) && !type.IsGenericTypeDefinition) ||
486
bool enableStructureCheck = (type !=
Globals
.TypeOfNullable);
System\Runtime\Serialization\DataMember.cs (1)
113
_emitDefaultValue =
Globals
.DefaultEmitDefaultValue;
System\Runtime\Serialization\DictionaryGlobals.cs (13)
14
public static readonly XmlDictionaryString SchemaInstanceNamespace = s_dictionary.Add(
Globals
.SchemaInstanceNamespace);
15
public static readonly XmlDictionaryString SerializationNamespace = s_dictionary.Add(
Globals
.SerializationNamespace);
16
public static readonly XmlDictionaryString SchemaNamespace = s_dictionary.Add(
Globals
.SchemaNamespace);
17
public static readonly XmlDictionaryString XsiTypeLocalName = s_dictionary.Add(
Globals
.XsiTypeLocalName);
18
public static readonly XmlDictionaryString XsiNilLocalName = s_dictionary.Add(
Globals
.XsiNilLocalName);
21
public static readonly XmlDictionaryString IdLocalName = s_dictionary.Add(
Globals
.IdLocalName);
22
public static readonly XmlDictionaryString RefLocalName = s_dictionary.Add(
Globals
.RefLocalName);
23
public static readonly XmlDictionaryString ArraySizeLocalName = s_dictionary.Add(
Globals
.ArraySizeLocalName);
25
public static readonly XmlDictionaryString ISerializableFactoryTypeLocalName = s_dictionary.Add(
Globals
.ISerializableFactoryTypeLocalName);
28
public static readonly XmlDictionaryString XmlnsNamespace = s_dictionary.Add(
Globals
.XmlnsNamespace);
58
public static readonly XmlDictionaryString ClrTypeLocalName = s_dictionary.Add(
Globals
.ClrTypeLocalName);
59
public static readonly XmlDictionaryString ClrAssemblyLocalName = s_dictionary.Add(
Globals
.ClrAssemblyLocalName);
60
public static readonly XmlDictionaryString Space = s_dictionary.Add(
Globals
.Space);
System\Runtime\Serialization\EnumDataContract.cs (5)
103
XmlQualifiedName xmlName = CreateQualifiedName(localName,
Globals
.SchemaNamespace);
135
IsFlags = type.IsDefined(
Globals
.TypeOfFlagsAttribute, false);
211
_isULong = (baseType ==
Globals
.TypeOfULong);
229
object[] memberAttributes = field.GetCustomAttributes(
Globals
.TypeOfEnumMemberAttribute, false).ToArray();
250
object[] dataMemberAttributes = field.GetCustomAttributes(
Globals
.TypeOfDataMemberAttribute, false).ToArray();
System\Runtime\Serialization\ExtensionDataObject.cs (24)
79
private string _id =
Globals
.NewObjectId;
142
get { return (Id !=
Globals
.NewObjectId); }
158
AddQualifiedNameAttribute(element,
Globals
.XsiPrefix,
Globals
.XsiTypeLocalName,
Globals
.SchemaInstanceNamespace, DataContractName, DataContractNamespace);
160
element.AddAttribute(
Globals
.SerPrefix,
Globals
.SerializationNamespace,
Globals
.ClrTypeLocalName, ClrTypeName);
162
element.AddAttribute(
Globals
.SerPrefix,
Globals
.SerializationNamespace,
Globals
.ClrAssemblyLocalName, ClrAssemblyName);
182
if (attribute != null && attribute.prefix ==
Globals
.XmlnsPrefix && attribute.localName == prefix)
190
element.AddAttribute(
Globals
.XmlnsPrefix,
Globals
.XmlnsNamespace, prefix, valueNs);
200
dataType =
Globals
.TypeOfClassDataNode;
224
dataType =
Globals
.TypeOfXmlDataNode;
263
dataType =
Globals
.TypeOfCollectionDataNode;
294
element.AddAttribute(
Globals
.SerPrefix,
Globals
.SerializationNamespace,
Globals
.ArraySizeLocalName, Size.ToString(NumberFormatInfo.InvariantInfo));
313
dataType =
Globals
.TypeOfISerializableDataNode;
339
AddQualifiedNameAttribute(element,
Globals
.SerPrefix,
Globals
.ISerializableFactoryTypeLocalName,
Globals
.SerializationNamespace, FactoryTypeName, FactoryTypeNamespace);
System\Runtime\Serialization\ExtensionDataReader.cs (27)
59
AddPrefix(
Globals
.XsiPrefix,
Globals
.SchemaInstanceNamespace);
60
AddPrefix(
Globals
.SerPrefix,
Globals
.SerializationNamespace);
462
if (dataNodeType ==
Globals
.TypeOfClassDataNode)
464
else if (dataNodeType ==
Globals
.TypeOfCollectionDataNode)
466
else if (dataNodeType ==
Globals
.TypeOfISerializableDataNode)
468
else if (dataNodeType ==
Globals
.TypeOfXmlDataNode)
491
_nextElement.AddAttribute(
Globals
.XsiPrefix,
Globals
.SchemaInstanceNamespace,
Globals
.XsiNilLocalName,
Globals
.True);
505
if (node.Id !=
Globals
.NewObjectId && (node.Value == null || !node.IsFinalValue))
515
if (node.Id !=
Globals
.NewObjectId)
522
_nextElement.AddAttribute(
Globals
.SerPrefix,
Globals
.SerializationNamespace,
Globals
.RefLocalName, node.Id.ToString(NumberFormatInfo.InvariantInfo));
523
_nextElement.AddAttribute(
Globals
.XsiPrefix,
Globals
.SchemaInstanceNamespace,
Globals
.XsiNilLocalName,
Globals
.True);
633
if (type ==
Globals
.TypeOfObject && dataNode.Value != null)
636
if (type ==
Globals
.TypeOfObject)
712
if (type ==
Globals
.TypeOfByteArray)
717
else if (type ==
Globals
.TypeOfTimeSpan)
719
else if (type ==
Globals
.TypeOfGuid)
724
else if (type ==
Globals
.TypeOfUri)
System\Runtime\Serialization\Globals.cs (4)
28
s_idQualifiedName ??= new XmlQualifiedName(
Globals
.IdLocalName,
Globals
.SerializationNamespace);
32
s_refQualifiedName ??= new XmlQualifiedName(
Globals
.RefLocalName,
Globals
.SerializationNamespace);
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (2)
564
if (itemType.IsGenericType && (itemType.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValue))
566
itemType =
Globals
.TypeOfKeyValuePair.MakeGenericType(itemType.GenericTypeArguments);
System\Runtime\Serialization\Json\JsonDataContract.cs (2)
245
traditionalDataContract.UnderlyingType ==
Globals
.TypeOfXmlQualifiedName)
298
DataContract itemDataContract = DataContract.GetDataContract(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GenericTypeArguments));
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (26)
108
s_collectionItemNameProperty = typeof(XmlObjectSerializerWriteContextComplexJson).GetProperty("CollectionItemName",
Globals
.ScanAllMembers);
118
typeof(ExtensionDataObject).GetConstructor(
Globals
.ScanAllMembers, Type.EmptyTypes))!;
141
s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract",
Globals
.ScanAllMembers)!.GetGetMethod(nonPublic: true);
154
s_getJsonDataContractMethod = typeof(JsonDataContract).GetMethod("GetJsonDataContract",
Globals
.ScanAllMembers);
167
s_getJsonMemberIndexMethod = typeof(XmlObjectSerializerReadContextComplexJson).GetMethod("GetJsonMemberIndex",
Globals
.ScanAllMembers);
180
s_getRevisedItemContractMethod = typeof(XmlObjectSerializerWriteContextComplexJson).GetMethod("GetRevisedItemContract",
Globals
.ScanAllMembers);
193
s_getUninitializedObjectMethod = typeof(XmlFormatReaderGenerator).GetMethod("UnsafeGetUninitializedObject",
Globals
.ScanAllMembers, new Type[] { typeof(Type) });
206
s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement",
Globals
.ScanAllMembers, Type.EmptyTypes);
218
s_isStartElementMethod2 = typeof(XmlReaderDelegator).GetMethod("IsStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
230
s_localNameProperty = typeof(XmlReaderDelegator).GetProperty("LocalName",
Globals
.ScanAllMembers);
242
s_namespaceProperty = typeof(XmlReaderDelegator).GetProperty("NamespaceProperty",
Globals
.ScanAllMembers);
266
s_moveToContentMethod = typeof(XmlReaderDelegator).GetMethod("MoveToContent",
Globals
.ScanAllMembers);
278
s_nodeTypeProperty = typeof(XmlReaderDelegator).GetProperty("NodeType",
Globals
.ScanAllMembers);
304
s_readJsonValueMethod = typeof(DataContractJsonSerializer).GetMethod("ReadJsonValue",
Globals
.ScanAllMembers);
329
s_throwDuplicateMemberExceptionMethod = typeof(XmlObjectSerializerReadContextComplexJson).GetMethod("ThrowDuplicateMemberException",
Globals
.ScanAllMembers);
341
s_throwMissingRequiredMembersMethod = typeof(XmlObjectSerializerReadContextComplexJson).GetMethod("ThrowMissingRequiredMembers",
Globals
.ScanAllMembers);
377
s_useSimpleDictionaryFormatReadProperty = typeof(XmlObjectSerializerReadContextComplexJson).GetProperty("UseSimpleDictionaryFormat",
Globals
.ScanAllMembers);
389
s_useSimpleDictionaryFormatWriteProperty = typeof(XmlObjectSerializerWriteContextComplexJson).GetProperty("UseSimpleDictionaryFormat",
Globals
.ScanAllMembers);
401
s_writeAttributeStringMethod = typeof(XmlWriterDelegator).GetMethod("WriteAttributeString",
Globals
.ScanAllMembers, new Type[] { typeof(string), typeof(string), typeof(string), typeof(string) });
413
s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement",
Globals
.ScanAllMembers, Type.EmptyTypes);
426
s_writeJsonISerializableMethod = typeof(XmlObjectSerializerWriteContextComplexJson).GetMethod("WriteJsonISerializable",
Globals
.ScanAllMembers);
438
s_writeJsonNameWithMappingMethod = typeof(XmlObjectSerializerWriteContextComplexJson).GetMethod("WriteJsonNameWithMapping",
Globals
.ScanAllMembers);
451
s_writeJsonValueMethod = typeof(DataContractJsonSerializer).GetMethod("WriteJsonValue",
Globals
.ScanAllMembers);
463
s_writeStartElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
476
s_writeStartElementStringMethod = typeof(XmlWriterDelegator).GetMethod("WriteStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(string), typeof(string) });
502
s_getJsonMemberNameMethod = typeof(XmlObjectSerializerReadContextComplexJson).GetMethod("GetJsonMemberName",
Globals
.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator) });
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (43)
92
if (
Globals
.TypeOfIDeserializationCallback.IsAssignableFrom(classContract.UnderlyingType))
105
if (classContract.UnderlyingType ==
Globals
.TypeOfDateTimeOffsetAdapter)
107
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfDateTimeOffsetAdapter);
109
_ilg.ConvertValue(
Globals
.TypeOfDateTimeOffset, _ilg.CurrentMethod.ReturnType);
111
else if (classContract.UnderlyingType ==
Globals
.TypeOfMemoryStreamAdapter)
113
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfMemoryStreamAdapter);
115
_ilg.ConvertValue(
Globals
.TypeOfMemoryStream, _ilg.CurrentMethod.ReturnType);
206
if (classContract.UnderlyingType ==
Globals
.TypeOfDBNull)
208
_ilg.LoadMember(
Globals
.TypeOfDBNull.GetField("Value")!);
227
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
262
return
Globals
.TypeOfIObjectReference.IsAssignableFrom(classContract.UnderlyingType);
271
_ilg.ConvertAddress(_objectLocal.LocalType,
Globals
.TypeOfIObjectReference);
272
_ilg.Load(
Globals
.NewObjectId);
274
_ilg.ConvertValue(
Globals
.TypeOfObject, _ilg.CurrentMethod.ReturnType);
287
LocalBuilder extensionDataLocal = _ilg.DeclareLocal(
Globals
.TypeOfExtensionDataObject);
319
LocalBuilder memberIndexLocal = _ilg.DeclareLocal(
Globals
.TypeOfInt, -1);
347
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfObject);
412
LocalBuilder localArray = _ilg.DeclareLocal(
Globals
.TypeOfByteArray);
454
ConstructorInfo? ctor = classContract.UnderlyingType.GetConstructor(
Globals
.ScanAllMembers, JsonFormatGeneratorStatics.SerInfoCtorArgs);
472
while (type.IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
479
if ((primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject) || nullables != 0 || type.IsValueType)
481
LocalBuilder objectId = _ilg.DeclareLocal(
Globals
.TypeOfString);
486
_ilg.If(objectId, Cmp.EqualTo,
Globals
.NullObjectId);
518
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject)
536
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
543
_ilg.If(objectId, Cmp.NotEqualTo,
Globals
.NullObjectId);
576
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
590
Type type =
Globals
.TypeOfNullable.MakeGenericType(innerType);
610
type =
Globals
.TypeOfDictionaryGeneric.MakeGenericType(itemType.GetGenericArguments());
614
type =
Globals
.TypeOfHashtable;
658
LocalBuilder objectId = _ilg.DeclareLocal(
Globals
.TypeOfString);
676
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt);
734
while (keyType.IsGenericType && keyType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
745
if (keyType ==
Globals
.TypeOfString || keyType ==
Globals
.TypeOfObject)
796
_ilg.ConvertValue(
Globals
.TypeOfObject, keyType);
825
LocalBuilder size = _ilg.DeclareLocal(
Globals
.TypeOfInt);
830
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
873
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt);
954
_ilg.Call(typeof(JsonReaderDelegator).GetMethod(readArrayMethod,
Globals
.ScanAllMembers)!);
974
_ilg.ConvertValue(
Globals
.TypeOfObject, itemType);
1013
if (collectionContract.AddMethod.ReturnType !=
Globals
.TypeOfVoid)
1023
if (collectionContract.AddMethod.ReturnType !=
Globals
.TypeOfVoid)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (39)
140
if (objType ==
Globals
.TypeOfDateTimeOffsetAdapter)
142
_ilg.ConvertValue(objectArg.ArgType,
Globals
.TypeOfDateTimeOffset);
145
else if (objType ==
Globals
.TypeOfMemoryStreamAdapter)
147
_ilg.ConvertValue(objectArg.ArgType,
Globals
.TypeOfMemoryStream);
213
LocalBuilder extensionDataLocal = _ilg.DeclareLocal(
Globals
.TypeOfExtensionDataObject);
215
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfIExtensibleDataObject);
317
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt);
354
incrementCollectionCountMethod = XmlFormatGeneratorStatics.IncrementCollectionCountGenericMethod.MakeGenericMethod(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionContract.ItemType.GetGenericArguments()));
369
enumeratorType =
Globals
.TypeOfGenericDictionaryEnumerator.MakeGenericType(keyValueTypes);
374
keyValueTypes = new Type[] {
Globals
.TypeOfObject,
Globals
.TypeOfObject };
375
enumeratorType =
Globals
.TypeOfDictionaryEnumerator;
381
MethodInfo? moveNextMethod = enumeratorType.GetMethod(
Globals
.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
382
MethodInfo? getCurrentMethod = enumeratorType.GetMethod(
Globals
.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
392
Type ienumeratorInterface =
Globals
.TypeOfIEnumerator;
400
&& interfaceType.GetGenericTypeDefinition() ==
Globals
.TypeOfIEnumeratorGeneric
409
moveNextMethod ??= CollectionDataContract.GetTargetMethodWithName(
Globals
.MoveNextMethodName, enumeratorType, ienumeratorInterface)!;
410
getCurrentMethod ??= CollectionDataContract.GetTargetMethodWithName(
Globals
.GetCurrentMethodName, enumeratorType, ienumeratorInterface)!;
420
ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(
Globals
.ScanAllMembers, new Type[] {
Globals
.TypeOfIDictionaryEnumerator })!;
421
_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType,
Globals
.TypeOfIDictionaryEnumerator);
427
Type ctorParam =
Globals
.TypeOfIEnumeratorGeneric.MakeGenericType(
Globals
.TypeOfKeyValuePair.MakeGenericType(keyValueTypes));
428
ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(
Globals
.ScanAllMembers, new Type[] { ctorParam })!;
438
Type genericDictionaryKeyValueType =
Globals
.TypeOfKeyValue.MakeGenericType(keyValueTypes);
446
LocalBuilder pairKey = _ilg.DeclareLocal(
Globals
.TypeOfString);
485
_ilg.ConvertValue(currentValue.LocalType,
Globals
.TypeOfObject);
511
if (primitiveContract == null || primitiveContract.UnderlyingType ==
Globals
.TypeOfObject)
595
Globals
.ScanAllMembers,
636
memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable);
662
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject)
675
if (memberType ==
Globals
.TypeOfObject || //boxed Nullable<T>
676
memberType ==
Globals
.TypeOfValueType ||
677
((IList)
Globals
.TypeOfNullable.GetInterfaces()).Contains(memberType))
680
_ilg.ConvertValue(memberValue.LocalType,
Globals
.TypeOfObject);
681
memberValue = _ilg.DeclareLocal(
Globals
.TypeOfObject);
691
if (memberType ==
Globals
.TypeOfObject) //boxed Nullable<T>
703
_ilg.ConvertValue(memberValue.LocalType,
Globals
.TypeOfObject);
725
while (memberType.IsGenericType && memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
System\Runtime\Serialization\Json\JsonGlobals.cs (1)
19
public static readonly int DataContractXsdBaseNamespaceLength =
Globals
.DataContractXsdBaseNamespace.Length;
System\Runtime\Serialization\Json\JsonObjectDataContract.cs (2)
50
return DataContractJsonSerializer.ReadJsonValue(DataContract.GetDataContract(
Globals
.TypeOfObjectArray), jsonReader, context);
70
throw new XmlException(SR.Format(SR.XmlInvalidConversion, value,
Globals
.TypeOfInt));
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (3)
154
while (keyType.IsGenericType && keyType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
165
if (keyType ==
Globals
.TypeOfString || keyType ==
Globals
.TypeOfObject)
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
90
if (primitiveContractForType != null && primitiveContractForType.UnderlyingType !=
Globals
.TypeOfObject)
System\Runtime\Serialization\Json\XmlJsonWriter.cs (2)
221
if (ns ==
Globals
.XmlnsNamespace)
223
return
Globals
.XmlnsPrefix;
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (2)
166
serverTypeNamespace = string.Concat(
Globals
.DataContractXsdBaseNamespace, serverTypeNamespace.AsSpan(1));
199
serverTypeNamespace = string.Concat(
Globals
.DataContractXsdBaseNamespace, serverTypeNamespace.AsSpan(1));
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (11)
87
else if (dataContractNamespace.StartsWith(
Globals
.DataContractXsdBaseNamespace, StringComparison.Ordinal))
104
(contract.UnderlyingType !=
Globals
.TypeOfObjectArray) &&
236
dataContract = GetDataContract(
Globals
.TypeOfIEnumerable);
295
if (dataType ==
Globals
.TypeOfClassDataNode ||
296
dataType ==
Globals
.TypeOfISerializableDataNode)
301
else if (dataType ==
Globals
.TypeOfCollectionDataNode)
306
else if (dataType ==
Globals
.TypeOfXmlDataNode)
310
else if ((dataType ==
Globals
.TypeOfObject) && (dataNode.Value != null))
323
if ((contractType == typeof(XmlDataContract)) && !
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(declaredType))
360
(oldItemContract.UnderlyingType.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValue))
415
itemContract = context.GetDataContract(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionContract.ItemType.GetGenericArguments()));
System\Runtime\Serialization\MemoryStreamAdapter.cs (2)
9
[DataContract(Name = nameof(MarshalByRefObject), Namespace =
Globals
.DataContractXsdBaseNamespace + "System")]
22
[DataContract(Name = "MemoryStream", Namespace =
Globals
.DataContractXsdBaseNamespace + "System.IO")]
System\Runtime\Serialization\PrimitiveDataContract.cs (8)
70
_helper.XmlFormatWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!;
72
_helper.XmlFormatWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!;
86
_helper.XmlFormatContentWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { UnderlyingType })!;
88
_helper.XmlFormatContentWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType })!;
95
_helper.XmlFormatReaderMethod ??= typeof(XmlReaderDelegator).GetMethod(ReadMethodName,
Globals
.ScanAllMembers)!;
114
if (attributes.Ref !=
Globals
.NewObjectId)
1101
writer.WriteStartElement(
Globals
.SerPrefix, name, ns);
1103
writer.WriteStartElement(
Globals
.ElementPrefix, name, ns);
System\Runtime\Serialization\ReflectionClassWriter.cs (6)
50
bool originValueIsNullableOfT = (memberType.IsGenericType && memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable);
88
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject && !writeXsiType)
95
(memberType ==
Globals
.TypeOfObject
122
if (primitiveContract == null || primitiveContract.UnderlyingType ==
Globals
.TypeOfObject)
155
if (type ==
Globals
.TypeOfDateTimeOffset)
159
else if (type ==
Globals
.TypeOfMemoryStream)
System\Runtime\Serialization\ReflectionReader.cs (11)
27
private static readonly Type[] s_arrayConstructorParameters = new Type[] {
Globals
.TypeOfInt };
253
while (type.IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
263
if ((primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject) || nullables != 0 || type.IsValueType)
294
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject)
348
while (type.IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
355
if ((primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject) || nullables != 0 || type.IsValueType)
442
if (objType ==
Globals
.TypeOfDateTimeOffsetAdapter)
446
else if (objType ==
Globals
.TypeOfMemoryStreamAdapter)
489
Type type =
Globals
.TypeOfDictionaryGeneric.MakeGenericType(collectionContract.ItemType.GetGenericArguments());
501
else if (collectionContract.UnderlyingType ==
Globals
.TypeOfIDictionary)
586
Type typeIList =
Globals
.TypeOfIList;
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (3)
61
if (primitiveContractForType != null && primitiveContractForType.UnderlyingType !=
Globals
.TypeOfObject)
212
xmlWriter.WriteStartElement(
Globals
.ElementPrefix, nameLocal, namespaceLocal);
227
return type ==
Globals
.TypeOfXmlQualifiedName && (ns != null && ns.Value != null && ns.Value.Length > 0);
System\Runtime\Serialization\SchemaExporter.cs (62)
66
if (!Schemas.Contains(
Globals
.SerializationNamespace))
68
StringReader reader = new StringReader(
Globals
.SerializationSchema);
71
throw new InvalidOperationException(SR.Format(SR.CouldNotReadSerializationSchema,
Globals
.SerializationNamespace));
126
genericInfoElement = ExportGenericInfo(classDataContract.UnderlyingType,
Globals
.GenericTypeLocalName,
Globals
.SerializationNamespace);
178
SchemaHelper.AddSchemaImport(
Globals
.SerializationNamespace, schema);
179
schema.Namespaces.Add(
Globals
.SerPrefixForSchema,
Globals
.SerializationNamespace);
194
if (element.SchemaTypeName.Namespace.Equals(
Globals
.SerializationNamespace))
195
schema.Namespaces.Add(
Globals
.SerPrefixForSchema,
Globals
.SerializationNamespace);
222
XmlAttribute emitDefaultValueAttribute = XmlDoc.CreateAttribute(
Globals
.EmitDefaultValueAttribute);
223
emitDefaultValueAttribute.Value =
Globals
.False;
237
XmlAttribute nameAttribute = xmlDoc.CreateAttribute(
Globals
.ActualTypeNameAttribute);
241
XmlAttribute nsAttribute = xmlDoc.CreateAttribute(
Globals
.ActualTypeNamespaceAttribute);
291
collectionName =
Globals
.ArrayPrefix + collectionName;
296
XmlAttribute nameAttribute = XmlDoc.CreateAttribute(
Globals
.GenericNameAttribute);
301
XmlAttribute nsAttribute = XmlDoc.CreateAttribute(
Globals
.GenericNamespaceAttribute);
314
XmlElement argumentElement = ExportGenericInfo(genericArguments[argIndex],
Globals
.GenericParameterLocalName,
Globals
.SerializationNamespace);
317
XmlAttribute nestedLevelAttribute = XmlDoc.CreateAttribute(
Globals
.GenericParameterNestedLevelAttribute);
327
XmlAttribute typeNestedLevelsAttribute = XmlDoc.CreateAttribute(
Globals
.GenericParameterNestedLevelAttribute);
350
DataContractSerializer serializer = new DataContractSerializer(
Globals
.TypeOfObject,
368
genericInfoElement = ExportGenericInfo(collectionDataContract.UnderlyingType,
Globals
.GenericTypeLocalName,
Globals
.SerializationNamespace);
378
element.MaxOccursString =
Globals
.OccursUnbounded;
417
isDictionaryElement.InnerText =
Globals
.True;
471
genericInfoElement = ExportGenericInfo(dataContract.UnderlyingType,
Globals
.GenericTypeLocalName,
Globals
.SerializationNamespace);
480
schema.Namespaces.Add(
Globals
.SerPrefixForSchema,
Globals
.SerializationNamespace);
610
object[] attrs = clrType.GetCustomAttributes(
Globals
.TypeOfXmlSchemaProviderAttribute, false);
636
if (!(
Globals
.TypeOfXmlQualifiedName.IsAssignableFrom(getMethod.ReturnType)) && !(
Globals
.TypeOfXmlSchemaType.IsAssignableFrom(getMethod.ReturnType)))
637
throw new InvalidDataContractException(SR.Format(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(
Globals
.TypeOfXmlQualifiedName), typeof(XmlSchemaType)));
751
if (type ==
Globals
.TypeOfXmlElement || type ==
Globals
.TypeOfXmlNodeArray)
754
if (type ==
Globals
.TypeOfXmlElement)
779
schemaRefElement.RefName = new XmlQualifiedName(
Globals
.SchemaLocalName, XmlSchema.Namespace);
867
iSerializableWildcardElement.MaxOccursString =
Globals
.OccursUnbounded;
875
internal static XmlQualifiedName AnytypeQualifiedName => s_anytypeQualifiedName ??= new XmlQualifiedName(
Globals
.AnyTypeLocalName,
Globals
.SchemaNamespace);
878
internal static XmlQualifiedName StringQualifiedName => s_stringQualifiedName ??= new XmlQualifiedName(
Globals
.StringLocalName,
Globals
.SchemaNamespace);
881
internal static XmlQualifiedName DefaultEnumBaseTypeName => s_defaultEnumBaseTypeName ??= new XmlQualifiedName(
Globals
.IntLocalName,
Globals
.SchemaNamespace);
884
internal static XmlQualifiedName EnumerationValueAnnotationName => s_enumerationValueAnnotationName ??= new XmlQualifiedName(
Globals
.EnumerationValueLocalName,
Globals
.SerializationNamespace);
887
internal static XmlQualifiedName SurrogateDataAnnotationName => s_surrogateDataAnnotationName ??= new XmlQualifiedName(
Globals
.SurrogateDataLocalName,
Globals
.SerializationNamespace);
890
internal static XmlQualifiedName DefaultValueAnnotation => s_defaultValueAnnotation ??= new XmlQualifiedName(
Globals
.DefaultValueLocalName,
Globals
.SerializationNamespace);
893
internal static XmlQualifiedName ActualTypeAnnotationName => s_actualTypeAnnotationName ??= new XmlQualifiedName(
Globals
.ActualTypeLocalName,
Globals
.SerializationNamespace);
896
internal static XmlQualifiedName IsDictionaryAnnotationName => s_isDictionaryAnnotationName ??= new XmlQualifiedName(
Globals
.IsDictionaryLocalName,
Globals
.SerializationNamespace);
899
internal static XmlQualifiedName IsValueTypeName => s_isValueTypeName ??= new XmlQualifiedName(
Globals
.IsValueTypeLocalName,
Globals
.SerializationNamespace);
908
iSerializableFactoryTypeAttribute.RefName = new XmlQualifiedName(
Globals
.ISerializableFactoryTypeLocalName,
Globals
.SerializationNamespace);
920
refAttribute.RefName =
Globals
.RefQualifiedName;
932
idAttribute.RefName =
Globals
.IdQualifiedName;
System\Runtime\Serialization\SchemaHelper.cs (3)
138
schema.Namespaces.Add(
Globals
.TnsPrefix, ns);
156
if (SchemaHelper.NamespacesEqual(ns, schema.TargetNamespace) || SchemaHelper.NamespacesEqual(ns,
Globals
.SchemaNamespace) || SchemaHelper.NamespacesEqual(ns,
Globals
.SchemaInstanceNamespace))
System\Runtime\Serialization\SchemaImporter.cs (50)
50
if (!_schemaSet.Contains(
Globals
.SerializationNamespace))
52
StringReader reader = new StringReader(
Globals
.SerializationSchema);
55
throw new InvalidOperationException(SR.Format(SR.CouldNotReadSerializationSchema,
Globals
.SerializationNamespace));
78
if (schema.TargetNamespace !=
Globals
.SerializationNamespace
79
&& schema.TargetNamespace !=
Globals
.SchemaNamespace)
143
element.Name =
Globals
.SchemaLocalName;
207
return dataContract is PrimitiveDataContract && ((PrimitiveDataContract)dataContract).UnderlyingType ==
Globals
.TypeOfObject;
250
if (schema.TargetNamespace !=
Globals
.SerializationNamespace)
506
if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(referencedType))
574
return (localElement.MaxOccursString ==
Globals
.OccursUnbounded || localElement.MaxOccurs > 1);
597
element.RefName.Namespace ==
Globals
.SerializationNamespace &&
602
XmlSchema serializationSchema = XmlSchema.Read(XmlReader.Create(new StringReader(
Globals
.SerializationSchema)), null)!; // Source is our constant. Schema is valid.
655
ClassDataContract dataContract = new ClassDataContract(
Globals
.TypeOfSchemaDefinedType);
706
xmlDataContract = new XmlDataContract(
Globals
.TypeOfSchemaDefinedType);
741
&&
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(referencedType))
748
return (XmlDataContract?)DataContract.GetBuiltInDataContract(
Globals
.TypeOfXmlElement);
751
return (XmlDataContract?)DataContract.GetBuiltInDataContract(
Globals
.TypeOfXmlNodeArray);
825
ClassDataContract dataContract = new ClassDataContract(
Globals
.TypeOfSchemaDefinedType);
995
memberEmitDefaultValue = emitDefaultValueFromAnnotation != null ? emitDefaultValueFromAnnotation.Value :
Globals
.DefaultEmitDefaultValue;
1004
if (prevMember.Order >
Globals
.DefaultOrder)
1026
XmlNode? emitDefaultValueAttribute = defaultValueElement.Attributes.GetNamedItem(
Globals
.EmitDefaultValueAttribute);
1028
throw new InvalidDataContractException(SR.Format(SR.AnnotationAttributeNotFound, SchemaExporter.DefaultValueAnnotation.Name, typeName.Name, typeName.Namespace,
Globals
.EmitDefaultValueAttribute));
1038
XmlNode? nameAttribute = actualTypeElement.Attributes.GetNamedItem(
Globals
.ActualTypeNameAttribute);
1040
throw new InvalidDataContractException(SR.Format(SR.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace,
Globals
.ActualTypeNameAttribute));
1041
XmlNode? nsAttribute = actualTypeElement.Attributes.GetNamedItem(
Globals
.ActualTypeNamespaceAttribute);
1043
throw new InvalidDataContractException(SR.Format(SR.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace,
Globals
.ActualTypeNamespaceAttribute));
1051
CollectionDataContract dataContract = new CollectionDataContract(
Globals
.TypeOfSchemaDefinedType, CollectionKind.Array);
1122
GenericInfo genericInfo = new GenericInfo(DataContract.GetXmlName(
Globals
.TypeOfKeyValue),
Globals
.TypeOfKeyValue.FullName);
1140
genericInfo = new GenericInfo(DataContract.GetXmlName(
Globals
.TypeOfNullable),
Globals
.TypeOfNullable.FullName);
1195
EnumDataContract dataContract = new EnumDataContract(
Globals
.TypeOfSchemaDefinedEnum);
1216
DataMember dataMember = new DataMember(
Globals
.SchemaMemberInfoPlaceholder) { Name = enumFacet.Value, Order = enumValue };
1273
if (typeElement != null && typeElement.NamespaceURI ==
Globals
.SerializationNamespace)
1275
if (typeElement.LocalName ==
Globals
.GenericTypeLocalName)
1285
string? name = typeElement.Attributes.GetNamedItem(
Globals
.GenericNameAttribute)?.Value;
1287
throw new InvalidDataContractException(SR.Format(SR.GenericAnnotationAttributeNotFound, type.Name,
Globals
.GenericNameAttribute));
1288
string? ns = typeElement.Attributes.GetNamedItem(
Globals
.GenericNamespaceAttribute)?.Value;
1290
throw new InvalidDataContractException(SR.Format(SR.GenericAnnotationAttributeNotFound, type.Name,
Globals
.GenericNamespaceAttribute));
1300
if (argumentElement.LocalName !=
Globals
.GenericParameterLocalName ||
1301
argumentElement.NamespaceURI !=
Globals
.SerializationNamespace)
1303
XmlNode? nestedLevelAttribute = argumentElement.Attributes.GetNamedItem(
Globals
.GenericParameterNestedLevelAttribute);
1308
throw new InvalidDataContractException(SR.Format(SR.GenericAnnotationHasInvalidAttributeValue, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name, nestedLevelAttribute.Value, nestedLevelAttribute.LocalName,
Globals
.TypeOfInt.Name));
1318
XmlNode? typeNestedLevelsAttribute = typeElement.Attributes.GetNamedItem(
Globals
.GenericParameterNestedLevelAttribute);
1323
throw new InvalidDataContractException(SR.Format(SR.GenericAnnotationHasInvalidAttributeValue, typeElement.LocalName, typeElement.NamespaceURI, type.Name, typeNestedLevelsAttribute.Value, typeNestedLevelsAttribute.LocalName,
Globals
.TypeOfInt.Name));
1338
DataContractSerializer serializer = new DataContractSerializer(
Globals
.TypeOfObject, name, ns, knownTypes,
1381
if (TryCheckIfAttribute(typeName, attribute,
Globals
.IdQualifiedName, ref foundId))
1383
if (TryCheckIfAttribute(typeName, attribute,
Globals
.RefQualifiedName, ref foundRef))
1385
if (attribute.RefName.IsEmpty || attribute.RefName.Namespace !=
Globals
.SerializationNamespace || attribute.Use == XmlSchemaUse.Required)
1386
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.Format(SR.TypeShouldNotContainAttributes,
Globals
.SerializationNamespace));
System\Runtime\Serialization\XmlDataContract.cs (7)
121
public override bool IsBuiltInDataContract => UnderlyingType ==
Globals
.TypeOfXmlElement || UnderlyingType ==
Globals
.TypeOfXmlNodeArray;
140
if (type.IsDefined(
Globals
.TypeOfDataContractAttribute, false))
142
if (type.IsDefined(
Globals
.TypeOfCollectionDataContractAttribute, false))
154
object[]? xmlRootAttributes = UnderlyingType?.GetCustomAttributes(
Globals
.TypeOfXmlRootAttribute, false).ToArray();
160
_topLevelElementNamespace = (this.XmlName.Namespace ==
Globals
.SchemaNamespace) ? DictionaryGlobals.EmptyString : Namespace;
327
ilg.ConvertValue(this.UnderlyingType,
Globals
.TypeOfIXmlSerializable);
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (73)
22
s_writeStartElementMethod2 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
36
s_writeStartElementMethod3 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(string), typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
50
s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement",
Globals
.ScanAllMembers, Type.EmptyTypes);
64
s_writeNamespaceDeclMethod = typeof(XmlWriterDelegator).GetMethod("WriteNamespaceDecl",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString) });
84
s_dictionaryEnumeratorCtor = typeof(CollectionDataContract.DictionaryEnumerator).GetConstructor(
Globals
.ScanAllMembers, new Type[] {
Globals
.TypeOfIDictionaryEnumerator });
127
s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract",
Globals
.ScanAllMembers)!.GetMethod;
141
s_isStartElementMethod2 = typeof(XmlReaderDelegator).GetMethod("IsStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
155
s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement",
Globals
.ScanAllMembers, Type.EmptyTypes);
170
s_getUninitializedObjectMethod = typeof(XmlFormatReaderGenerator).GetMethod("UnsafeGetUninitializedObject",
Globals
.ScanAllMembers, new Type[] { typeof(int) })!;
201
s_nodeTypeProperty = typeof(XmlReaderDelegator).GetProperty("NodeType",
Globals
.ScanAllMembers);
212
internal static ConstructorInfo ExtensionDataObjectCtor => s_extensionDataObjectCtor ??= typeof(ExtensionDataObject).GetConstructor(
Globals
.ScanAllMembers, Type.EmptyTypes)!;
223
s_hashtableCtor =
Globals
.TypeOfHashtable.GetConstructor(
Globals
.ScanAllMembers, Type.EmptyTypes);
237
s_getStreamingContextMethod = typeof(XmlObjectSerializerContext).GetMethod("GetStreamingContext",
Globals
.ScanAllMembers);
251
s_getCollectionMemberMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetCollectionMember",
Globals
.ScanAllMembers);
265
s_storeCollectionMemberInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("StoreCollectionMemberInfo",
Globals
.ScanAllMembers, new Type[] { typeof(object) });
279
s_resetCollectionMemberInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ResetCollectionMemberInfo",
Globals
.ScanAllMembers, Type.EmptyTypes);
293
s_storeIsGetOnlyCollectionMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("StoreIsGetOnlyCollection",
Globals
.ScanAllMembers);
307
s_resetIsGetOnlyCollection = typeof(XmlObjectSerializerWriteContext).GetMethod("ResetIsGetOnlyCollection",
Globals
.ScanAllMembers);
321
s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ThrowNullValueReturnedForGetOnlyCollectionException",
Globals
.ScanAllMembers);
335
s_throwArrayExceededSizeExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ThrowArrayExceededSizeException",
Globals
.ScanAllMembers);
349
s_incrementItemCountMethod = typeof(XmlObjectSerializerContext).GetMethod("IncrementItemCount",
Globals
.ScanAllMembers);
364
s_internalDeserializeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("InternalDeserialize",
Globals
.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(int), typeof(RuntimeTypeHandle), typeof(string), typeof(string) });
378
s_moveToNextElementMethod = typeof(XmlObjectSerializerReadContext).GetMethod("MoveToNextElement",
Globals
.ScanAllMembers);
393
s_getMemberIndexMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetMemberIndex",
Globals
.ScanAllMembers);
408
s_getMemberIndexWithRequiredMembersMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetMemberIndexWithRequiredMembers",
Globals
.ScanAllMembers);
422
s_throwRequiredMemberMissingExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ThrowRequiredMemberMissingException",
Globals
.ScanAllMembers);
436
s_skipUnknownElementMethod = typeof(XmlObjectSerializerReadContext).GetMethod("SkipUnknownElement",
Globals
.ScanAllMembers);
451
s_readIfNullOrRefMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadIfNullOrRef",
Globals
.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(Type), typeof(bool) });
465
s_readAttributesMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadAttributes",
Globals
.ScanAllMembers);
479
s_resetAttributesMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ResetAttributes",
Globals
.ScanAllMembers);
493
s_getObjectIdMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetObjectId",
Globals
.ScanAllMembers);
507
s_getArraySizeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetArraySize",
Globals
.ScanAllMembers);
521
s_addNewObjectMethod = typeof(XmlObjectSerializerReadContext).GetMethod("AddNewObject",
Globals
.ScanAllMembers);
535
s_addNewObjectWithIdMethod = typeof(XmlObjectSerializerReadContext).GetMethod("AddNewObjectWithId",
Globals
.ScanAllMembers);
549
s_replaceDeserializedObjectMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReplaceDeserializedObject",
Globals
.ScanAllMembers);
564
s_getExistingObjectMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetExistingObject",
Globals
.ScanAllMembers);
578
s_getRealObjectMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetRealObject",
Globals
.ScanAllMembers);
592
s_ensureArraySizeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("EnsureArraySize",
Globals
.ScanAllMembers);
606
s_trimArraySizeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("TrimArraySize",
Globals
.ScanAllMembers);
620
s_checkEndOfArrayMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CheckEndOfArray",
Globals
.ScanAllMembers);
649
s_readSerializationInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadSerializationInfo",
Globals
.ScanAllMembers);
663
s_createUnexpectedStateExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CreateUnexpectedStateException",
Globals
.ScanAllMembers, new Type[] { typeof(XmlNodeType), typeof(XmlReaderDelegator) });
678
s_internalSerializeReferenceMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("InternalSerializeReference",
Globals
.ScanAllMembers);
693
s_internalSerializeMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("InternalSerialize",
Globals
.ScanAllMembers);
708
s_writeNullMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("WriteNull",
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(Type), typeof(bool) });
722
s_incrementArrayCountMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementArrayCount",
Globals
.ScanAllMembers);
736
s_incrementCollectionCountMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementCollectionCount",
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(ICollection) });
750
s_incrementCollectionCountGenericMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementCollectionCountGeneric",
Globals
.ScanAllMembers);
764
s_getDefaultValueMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(nameof(XmlObjectSerializerWriteContext.GetDefaultValue),
Globals
.ScanAllMembers);
786
s_getNullableValueMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("GetNullableValue",
Globals
.ScanAllMembers);
800
s_throwRequiredMemberMustBeEmittedMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("ThrowRequiredMemberMustBeEmitted",
Globals
.ScanAllMembers);
814
s_getHasValueMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("GetHasValue",
Globals
.ScanAllMembers);
829
s_writeISerializableMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("WriteISerializable",
Globals
.ScanAllMembers);
840
get => s_writeExtensionDataMethod ??= typeof(XmlObjectSerializerWriteContext).GetMethod("WriteExtensionData",
Globals
.ScanAllMembers)!;
851
s_writeXmlValueMethod = typeof(DataContract).GetMethod("WriteXmlValue",
Globals
.ScanAllMembers);
866
s_readXmlValueMethod = typeof(DataContract).GetMethod("ReadXmlValue",
Globals
.ScanAllMembers);
880
s_namespaceProperty = typeof(DataContract).GetProperty("Namespace",
Globals
.ScanAllMembers);
894
s_contractNamespacesField = typeof(ClassDataContract).GetField("ContractNamespaces",
Globals
.ScanAllMembers);
908
s_memberNamesField = typeof(ClassDataContract).GetField("MemberNames",
Globals
.ScanAllMembers);
916
internal static MethodInfo ExtensionDataSetExplicitMethodInfo => s_extensionDataSetExplicitMethodInfo ??= typeof(IExtensibleDataObject).GetMethod(
Globals
.ExtensionDataSetMethod)!;
926
s_childElementNamespacesProperty = typeof(ClassDataContract).GetProperty("ChildElementNamespaces",
Globals
.ScanAllMembers);
940
s_collectionItemNameProperty = typeof(CollectionDataContract).GetProperty("CollectionItemName",
Globals
.ScanAllMembers);
955
s_childElementNamespaceProperty = typeof(CollectionDataContract).GetProperty("ChildElementNamespace",
Globals
.ScanAllMembers);
969
s_getDateTimeOffsetMethod = typeof(DateTimeOffsetAdapter).GetMethod("GetDateTimeOffset",
Globals
.ScanAllMembers);
983
s_getDateTimeOffsetAdapterMethod = typeof(DateTimeOffsetAdapter).GetMethod("GetDateTimeOffsetAdapter",
Globals
.ScanAllMembers);
997
s_getMemoryStreamMethod = typeof(MemoryStreamAdapter).GetMethod("GetMemoryStream",
Globals
.ScanAllMembers);
1011
s_getMemoryStreamAdapterMethod = typeof(MemoryStreamAdapter).GetMethod("GetMemoryStreamAdapter",
Globals
.ScanAllMembers);
1053
s_throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException",
Globals
.ScanAllMembers, new Type[] { typeof(string), typeof(Type) });
1067
s_serializeReadOnlyTypesProperty = typeof(XmlObjectSerializerWriteContext).GetProperty("SerializeReadOnlyTypes",
Globals
.ScanAllMembers);
1081
s_classSerializationExceptionMessageProperty = typeof(ClassDataContract).GetProperty("SerializationExceptionMessage",
Globals
.ScanAllMembers);
1095
s_collectionSerializationExceptionMessageProperty = typeof(CollectionDataContract).GetProperty("SerializationExceptionMessage",
Globals
.ScanAllMembers);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (43)
92
_ilg.BeginMethod("Read" + classContract.XmlName.Name + "FromXml",
Globals
.TypeOfXmlFormatClassReaderDelegate, memberAccessFlag);
113
objectId = _ilg.DeclareLocal(
Globals
.TypeOfString);
128
if (
Globals
.TypeOfIDeserializationCallback.IsAssignableFrom(classContract.UnderlyingType))
142
if (classContract.UnderlyingType ==
Globals
.TypeOfDateTimeOffsetAdapter)
144
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfDateTimeOffsetAdapter);
146
_ilg.ConvertValue(
Globals
.TypeOfDateTimeOffset, _ilg.CurrentMethod.ReturnType);
148
else if (classContract.UnderlyingType ==
Globals
.TypeOfMemoryStreamAdapter)
150
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfMemoryStreamAdapter);
152
_ilg.ConvertValue(
Globals
.TypeOfMemoryStream, _ilg.CurrentMethod.ReturnType);
220
_ilg.BeginMethod("Read" + collectionContract.XmlName.Name + "FromXml" + "IsGetOnly",
Globals
.TypeOfXmlFormatGetOnlyCollectionReaderDelegate, memberAccessFlag);
224
_ilg.BeginMethod("Read" + collectionContract.XmlName.Name + "FromXml" + string.Empty,
Globals
.TypeOfXmlFormatCollectionReaderDelegate, memberAccessFlag);
258
type =
Globals
.TypeOfValueType;
262
if (classContract.UnderlyingType ==
Globals
.TypeOfDBNull)
283
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
326
return
Globals
.TypeOfIObjectReference.IsAssignableFrom(classContract.UnderlyingType);
337
_ilg.ConvertAddress(_objectLocal.LocalType,
Globals
.TypeOfIObjectReference);
340
_ilg.ConvertValue(
Globals
.TypeOfObject, _ilg.CurrentMethod.ReturnType);
353
LocalBuilder extensionDataLocal = _ilg.DeclareLocal(
Globals
.TypeOfExtensionDataObject);
380
LocalBuilder memberIndexLocal = _ilg.DeclareLocal(
Globals
.TypeOfInt, -1);
385
LocalBuilder? requiredIndexLocal = hasRequiredMembers ? _ilg.DeclareLocal(
Globals
.TypeOfInt, firstRequiredMember) : null;
509
while (type.IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
516
if ((primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject) || nullables != 0 || type.IsValueType)
518
LocalBuilder objectId = _ilg.DeclareLocal(
Globals
.TypeOfString);
523
_ilg.If(objectId, Cmp.EqualTo,
Globals
.NullObjectId);
555
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject)
573
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
580
_ilg.If(objectId, Cmp.NotEqualTo,
Globals
.NullObjectId);
599
Type declaredType = type.IsPointer ?
Globals
.TypeOfReflectionPointer : type;
609
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
623
Type type =
Globals
.TypeOfNullable.MakeGenericType(innerType);
646
type =
Globals
.TypeOfDictionaryGeneric.MakeGenericType(itemType.GetGenericArguments());
650
type =
Globals
.TypeOfHashtable;
683
LocalBuilder size = _ilg.DeclareLocal(
Globals
.TypeOfInt);
687
LocalBuilder objectId = _ilg.DeclareLocal(
Globals
.TypeOfString);
707
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt);
749
LocalBuilder j = _ilg.DeclareLocal(
Globals
.TypeOfInt);
786
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
796
LocalBuilder size = _ilg.DeclareLocal(
Globals
.TypeOfInt);
806
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt);
882
_ilg.Call(typeof(XmlReaderDelegator).GetMethod(readArrayMethod,
Globals
.ScanAllMembers)!);
901
_ilg.ConvertValue(
Globals
.TypeOfObject, itemType);
936
if (collectionContract.AddMethod.ReturnType !=
Globals
.TypeOfVoid)
942
if (collectionContract.AddMethod.ReturnType !=
Globals
.TypeOfVoid)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (40)
86
_ilg.BeginMethod("Write" + classContract.XmlName.Name + "ToXml",
Globals
.TypeOfXmlFormatClassWriterDelegate, memberAccessFlag);
130
_ilg.BeginMethod("Write" + collectionContract.XmlName.Name + "ToXml",
Globals
.TypeOfXmlFormatCollectionWriterDelegate, memberAccessFlag);
168
if (objType ==
Globals
.TypeOfDateTimeOffsetAdapter)
170
_ilg.ConvertValue(objectArg.ArgType,
Globals
.TypeOfDateTimeOffset);
173
else if (objType ==
Globals
.TypeOfMemoryStreamAdapter)
175
_ilg.ConvertValue(objectArg.ArgType,
Globals
.TypeOfMemoryStream);
271
LocalBuilder extensionDataLocal = _ilg.DeclareLocal(
Globals
.TypeOfExtensionDataObject);
273
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfIExtensibleDataObject);
397
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt);
433
incrementCollectionCountMethod = XmlFormatGeneratorStatics.IncrementCollectionCountGenericMethod.MakeGenericMethod(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionContract.ItemType.GetGenericArguments()));
448
enumeratorType =
Globals
.TypeOfGenericDictionaryEnumerator.MakeGenericType(keyValueTypes);
453
keyValueTypes = new Type[] {
Globals
.TypeOfObject,
Globals
.TypeOfObject };
454
enumeratorType =
Globals
.TypeOfDictionaryEnumerator;
460
MethodInfo? moveNextMethod = enumeratorType.GetMethod(
Globals
.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
461
MethodInfo? getCurrentMethod = enumeratorType.GetMethod(
Globals
.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
471
Type ienumeratorInterface =
Globals
.TypeOfIEnumerator;
479
&& interfaceType.GetGenericTypeDefinition() ==
Globals
.TypeOfIEnumeratorGeneric
488
moveNextMethod ??= CollectionDataContract.GetTargetMethodWithName(
Globals
.MoveNextMethodName, enumeratorType, ienumeratorInterface)!;
489
getCurrentMethod ??= CollectionDataContract.GetTargetMethodWithName(
Globals
.GetCurrentMethodName, enumeratorType, ienumeratorInterface)!;
499
_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType,
Globals
.TypeOfIDictionaryEnumerator);
504
Type ctorParam =
Globals
.TypeOfIEnumeratorGeneric.MakeGenericType(
Globals
.TypeOfKeyValuePair.MakeGenericType(keyValueTypes!));
505
ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(
Globals
.ScanAllMembers, new Type[] { ctorParam })!;
525
_ilg.ConvertValue(currentValue.LocalType,
Globals
.TypeOfObject);
544
if (primitiveContract == null || primitiveContract.UnderlyingType ==
Globals
.TypeOfObject)
628
_ilg.Call(typeof(XmlWriterDelegator).GetMethod(writeArrayMethod,
Globals
.ScanAllMembers, new Type[] { type, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!);
644
memberType =
Globals
.TypeOfReflectionPointer;
649
memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable);
675
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject && !writeXsiType)
688
if (memberType ==
Globals
.TypeOfObject ||//boxed Nullable<T>
689
memberType ==
Globals
.TypeOfValueType ||
690
((IList)
Globals
.TypeOfNullable.GetInterfaces()).Contains(memberType))
693
_ilg.ConvertValue(memberValue.LocalType,
Globals
.TypeOfObject);
694
memberValue = _ilg.DeclareLocal(
Globals
.TypeOfObject);
704
if (memberType ==
Globals
.TypeOfObject) //boxed Nullable<T>
716
_ilg.ConvertValue(memberValue.LocalType,
Globals
.TypeOfObject);
738
while (memberType.IsGenericType && memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
762
return type ==
Globals
.TypeOfXmlQualifiedName && (ns != null && ns.Value != null && ns.Value.Length > 0);
771
_ilg.Load(
Globals
.ElementPrefix);
System\Runtime\Serialization\XmlObjectSerializer.cs (2)
259
writer.WriteAttributeBool(
Globals
.XsiPrefix, DictionaryGlobals.XsiNilLocalName, DictionaryGlobals.SchemaInstanceNamespace, true);
426
DataContract objectContract = PrimitiveDataContract.GetPrimitiveDataContract(
Globals
.TypeOfObject)!;
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (22)
117
if (attributes.Ref !=
Globals
.NewObjectId)
121
throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(declaredType)), SR.Format(SR.XmlStartElementExpected,
Globals
.RefLocalName)));
298
if (attributes.Ref !=
Globals
.NewObjectId)
308
return
Globals
.NullObjectId;
310
return
Globals
.NewObjectId;
346
if (id !=
Globals
.NewObjectId)
357
if (id !=
Globals
.NewObjectId)
520
if (xmlDataContract.UnderlyingType ==
Globals
.TypeOfXmlElement)
527
else if (xmlDataContract.UnderlyingType ==
Globals
.TypeOfXmlNodeArray)
567
if (attributes.Ref !=
Globals
.NewObjectId)
579
value = InternalDeserialize(xmlReader,
Globals
.TypeOfObject, name, string.Empty);
617
if (attributes.Ref !=
Globals
.NewObjectId)
671
if (attributes.Id ==
Globals
.NewObjectId)
729
if (xmlReader.NamespaceURI.StartsWith(
Globals
.DataContractXsdBaseNamespace, StringComparison.Ordinal))
737
IDataNode objNode = ReadUnknownPrimitiveData(xmlReader,
Globals
.TypeOfObject, dataContractName, dataContractNamespace);
750
if (valueType ==
Globals
.TypeOfString)
915
if (ns !=
Globals
.SerializationNamespace && ns !=
Globals
.SchemaInstanceNamespace)
1074
Document.CreateAttribute(null,
Globals
.XmlnsPrefix,
Globals
.XmlnsNamespace) :
1075
Document.CreateAttribute(
Globals
.XmlnsPrefix, prefix,
Globals
.XmlnsNamespace);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (18)
99
Type declaredType =
Globals
.TypeOfObject;
219
xmlWriter.WriteAttributeString(
Globals
.SerPrefix, DictionaryGlobals.IdLocalName,
225
xmlWriter.WriteAttributeString(
Globals
.SerPrefix, DictionaryGlobals.RefLocalName, DictionaryGlobals.SerializationNamespace, string.Create(CultureInfo.InvariantCulture, $"i{objectId}"));
357
xmlWriter.WriteStartElement(
Globals
.ElementPrefix, name, ns);
367
writer.WriteXmlnsAttribute(
Globals
.XsiPrefix, DictionaryGlobals.SchemaInstanceNamespace);
370
writer.WriteXmlnsAttribute(
Globals
.XsdPrefix, DictionaryGlobals.SchemaNamespace);
544
xmlWriter.WriteAttributeQualifiedName(
Globals
.SerPrefix, DictionaryGlobals.ISerializableFactoryTypeLocalName, DictionaryGlobals.SerializationNamespace, typeName, typeNs);
551
xmlWriter.WriteAttributeQualifiedName(
Globals
.SerPrefix, DictionaryGlobals.ISerializableFactoryTypeLocalName, DictionaryGlobals.SerializationNamespace, DataContract.GetClrTypeString(typeName), DataContract.GetClrTypeString(typeNs));
568
InternalSerializeReference(xmlWriter, obj, false /*isDeclaredType*/, false /*writeXsiType*/, -1,
Globals
.TypeOfObject.TypeHandle);
648
writer.WriteAttributeQualifiedName(
Globals
.XsiPrefix, DictionaryGlobals.XsiTypeLocalName, DictionaryGlobals.SchemaInstanceNamespace, dataContractName, dataContractNamespace);
653
writer.WriteAttributeQualifiedName(
Globals
.XsiPrefix, DictionaryGlobals.XsiTypeLocalName, DictionaryGlobals.SchemaInstanceNamespace, dataContractName, dataContractNamespace);
713
if (dataType ==
Globals
.TypeOfClassDataNode)
715
else if (dataType ==
Globals
.TypeOfCollectionDataNode)
717
else if (dataType ==
Globals
.TypeOfXmlDataNode)
719
else if (dataType ==
Globals
.TypeOfISerializableDataNode)
725
if (dataType ==
Globals
.TypeOfObject)
748
Type declaredType = (dataNode.DataContractName == null) ? o.GetType() :
Globals
.TypeOfObject;
804
xmlWriter.WriteAttributeQualifiedName(
Globals
.SerPrefix, DictionaryGlobals.ISerializableFactoryTypeLocalName, DictionaryGlobals.SerializationNamespace, dataNode.FactoryTypeName, dataNode.FactoryTypeNamespace);
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (6)
130
xmlWriter.WriteStartElement(
Globals
.ElementPrefix, name, ns);
160
xmlWriter.WriteAttributeInt(
Globals
.SerPrefix, DictionaryGlobals.IdLocalName, DictionaryGlobals.SerializationNamespace, objectId);
163
xmlWriter.WriteAttributeInt(
Globals
.SerPrefix, DictionaryGlobals.RefLocalName, DictionaryGlobals.SerializationNamespace, objectId);
164
xmlWriter.WriteAttributeBool(
Globals
.XsiPrefix, DictionaryGlobals.XsiNilLocalName, DictionaryGlobals.SchemaInstanceNamespace, true);
238
declaredType =
Globals
.TypeOfObject;
257
xmlWriter.WriteAttributeInt(
Globals
.SerPrefix, DictionaryGlobals.ArraySizeLocalName, DictionaryGlobals.SerializationNamespace, size);
System\Runtime\Serialization\XmlReaderDelegator.cs (12)
263
if (valueType ==
Globals
.TypeOfByteArray)
265
else if (valueType ==
Globals
.TypeOfObject)
267
else if (valueType ==
Globals
.TypeOfTimeSpan)
269
else if (valueType ==
Globals
.TypeOfGuid)
271
else if (valueType ==
Globals
.TypeOfUri)
273
else if (valueType ==
Globals
.TypeOfXmlQualifiedName)
318
if (valueType ==
Globals
.TypeOfByteArray)
320
else if (valueType ==
Globals
.TypeOfObject)
322
else if (valueType ==
Globals
.TypeOfTimeSpan)
324
else if (valueType ==
Globals
.TypeOfGuid)
326
else if (valueType ==
Globals
.TypeOfUri)
328
else if (valueType ==
Globals
.TypeOfXmlQualifiedName)
System\Runtime\Serialization\XmlSerializableServices.cs (2)
49
return xmlReader.NamespaceURI !=
Globals
.SerializationNamespace &&
50
xmlReader.NamespaceURI !=
Globals
.SchemaInstanceNamespace &&
System\Runtime\Serialization\XmlWriterDelegator.cs (12)
336
if (valueType ==
Globals
.TypeOfByteArray)
338
else if (valueType ==
Globals
.TypeOfObject)
342
else if (valueType ==
Globals
.TypeOfTimeSpan)
344
else if (valueType ==
Globals
.TypeOfGuid)
346
else if (valueType ==
Globals
.TypeOfUri)
348
else if (valueType ==
Globals
.TypeOfXmlQualifiedName)
413
if (valueType ==
Globals
.TypeOfByteArray)
415
else if (valueType ==
Globals
.TypeOfObject)
421
else if (valueType ==
Globals
.TypeOfTimeSpan)
423
else if (valueType ==
Globals
.TypeOfGuid)
425
else if (valueType ==
Globals
.TypeOfUri)
427
else if (valueType ==
Globals
.TypeOfXmlQualifiedName)