566 references to Globals
dotnet-svcutil-lib (566)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Attributes.cs (2)
118
Id =
Globals
.NewObjectId;
119
Ref =
Globals
.NewObjectId;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\BitFlagsGenerator.cs (1)
71
LocalBuilder localArray = _ilg.DeclareLocal(
Globals
.TypeOfByteArray, "localArray");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (25)
386
if (!childType.GetTypeInfo().IsEnum && !
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(childType)
387
&& DataContract.GetBuiltInDataContract(childType) == null && childType !=
Globals
.TypeOfDBNull)
419
if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
425
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfCollectionDataContractAttribute))
440
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfDataContractAttribute))
490
if (
Globals
.TypeOfException.IsAssignableFrom(type))
574
if (
Globals
.TypeOfScriptObject_IsAssignableFrom(UnderlyingType))
785
if (type ==
Globals
.TypeOfDBNull)
800
if (baseType != null && baseType !=
Globals
.TypeOfObject && baseType !=
Globals
.TypeOfValueType && baseType !=
Globals
.TypeOfUri)
851
Globals
.TypeOfScriptObject_IsAssignableFrom(this.UnderlyingType);
1088
field.FieldType !=
Globals
.TypeOfObject; // Don't really know how to serialize plain System.Object instance;
1208
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnSerializingAttribute, _onSerializing, ref prevAttributeType))
1210
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnSerializedAttribute, _onSerialized, ref prevAttributeType))
1212
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnDeserializingAttribute, _onDeserializing, ref prevAttributeType))
1214
if (IsValidCallback(method, parameters,
Globals
.TypeOfOnDeserializedAttribute, _onDeserialized, ref prevAttributeType))
1237
if (method.ReturnType !=
Globals
.TypeOfVoid)
1239
if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType !=
Globals
.TypeOfStreamingContext)
1240
DataContract.ThrowInvalidDataContractException(string.Format(SRSerialization.CallbackParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method,
Globals
.TypeOfStreamingContext), method.DeclaringType);
1350
if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValuePairAdapter)
1354
_keyValuePairCtorInfo = type.GetConstructor(
Globals
.ScanAllMembers, new Type[] {
Globals
.TypeOfKeyValuePair.MakeGenericType(_keyValuePairGenericArguments) });
1355
_getKeyValuePairMethodInfo = type.GetMethod("GetKeyValuePair",
Globals
.ScanAllMembers);
1516
type =
Globals
.TypeOfValueType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (96)
374
get { return DataContract.GetStableName(
Globals
.TypeOfListGeneric); }
379
get { return _dataContractSet.GetDataContract(
Globals
.TypeOfListGeneric) as CollectionDataContract; }
384
get { return DataContract.GetStableName(
Globals
.TypeOfDictionaryGeneric); }
389
get { return _dataContractSet.GetDataContract(
Globals
.TypeOfDictionaryGeneric) as CollectionDataContract; }
424
typeName = GetClrIdentifier(typeName,
Globals
.DefaultTypeName);
475
nestedTypeName = GetClrIdentifier(nestedTypeName,
Globals
.DefaultTypeName);
545
if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
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)));
625
(collectionContract.KeyName !=
Globals
.KeyLocalName || collectionContract.ValueName !=
Globals
.ValueLocalName))
640
type =
Globals
.TypeOfDictionaryGeneric;
711
bool enableStructureCheck = (type !=
Globals
.TypeOfNullable);
740
if (type ==
Globals
.TypeOfNullable && !isParamValueType)
815
CodeAttributeDeclaration dataContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfDataContractAttribute));
816
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NameProperty, new CodePrimitiveExpression(dataContractName)));
817
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NamespaceProperty, new CodePrimitiveExpression(classDataContract.StableName.Namespace)));
818
if (classDataContract.IsReference !=
Globals
.DefaultIsReference)
819
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.IsReferenceProperty, new CodePrimitiveExpression(classDataContract.IsReference)));
821
AddImportStatement(
Globals
.TypeOfDataContractAttribute.Namespace, contractCodeDomInfo.CodeNamespace);
831
type.BaseTypes.Add(
Globals
.TypeOfObject);
845
if (!
Globals
.TypeOfIExtensibleDataObject.IsAssignableFrom(actualType))
847
if (!
Globals
.TypeOfIPropertyChange.IsAssignableFrom(actualType))
869
string fieldName = GetMemberName(AppendToValidClrIdentifier(propertyName,
Globals
.DefaultFieldSuffix), contractCodeDomInfo);
880
CodeAttributeDeclaration dataMemberAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfDataMemberAttribute));
882
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NameProperty, new CodePrimitiveExpression(dataMemberName)));
883
if (dataMember.IsRequired !=
Globals
.DefaultIsRequired)
884
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.IsRequiredProperty, new CodePrimitiveExpression(dataMember.IsRequired)));
885
if (dataMember.EmitDefaultValue !=
Globals
.DefaultEmitDefaultValue)
886
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.EmitDefaultValueProperty, new CodePrimitiveExpression(dataMember.EmitDefaultValue)));
887
if (dataMember.Order !=
Globals
.DefaultOrder)
888
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.OrderProperty, new CodePrimitiveExpression(dataMember.Order)));
1002
CodeAttributeDeclaration knownTypeAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfKnownTypeAttribute));
1006
AddImportStatement(
Globals
.TypeOfKnownTypeAttribute.Namespace, contractCodeDomInfo.CodeNamespace);
1014
CodeTypeReference nullableOfMemberType = GetCodeTypeReference(
Globals
.TypeOfNullable);
1024
type.BaseTypes.Add(DataContract.GetClrTypeFullName(
Globals
.TypeOfIExtensibleDataObject));
1069
type.CustomAttributes.Add(new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfFlagsAttribute)));
1070
AddImportStatement(
Globals
.TypeOfFlagsAttribute.Namespace, contractCodeDomInfo.CodeNamespace);
1074
CodeAttributeDeclaration dataContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfDataContractAttribute));
1075
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NameProperty, new CodePrimitiveExpression(dataContractName)));
1076
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NamespaceProperty, new CodePrimitiveExpression(enumDataContract.StableName.Namespace)));
1078
AddImportStatement(
Globals
.TypeOfDataContractAttribute.Namespace, contractCodeDomInfo.CodeNamespace);
1093
CodeAttributeDeclaration enumMemberAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfEnumMemberAttribute));
1095
enumMemberAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.ValueProperty, new CodePrimitiveExpression(stringValue)));
1148
baseTypeReference = GetCodeTypeReference(
Globals
.TypeOfListGeneric);
1153
string expectedTypeName =
Globals
.ArrayPrefix + itemContract.StableName.Name;
1157
expectedTypeName, expectedTypeNs, DataContract.GetClrTypeFullName(
Globals
.TypeOfIListGeneric), DataContract.GetClrTypeFullName(
Globals
.TypeOfICollectionGeneric))));
1164
CodeAttributeDeclaration collectionContractAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfCollectionDataContractAttribute));
1165
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NameProperty, new CodePrimitiveExpression(dataContractName)));
1166
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.NamespaceProperty, new CodePrimitiveExpression(collectionContract.StableName.Namespace)));
1167
if (collectionContract.IsReference !=
Globals
.DefaultIsReference)
1168
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.IsReferenceProperty, new CodePrimitiveExpression(collectionContract.IsReference)));
1169
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.ItemNameProperty, new CodePrimitiveExpression(GetNameForAttribute(collectionContract.ItemName))));
1172
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.KeyNameProperty, new CodePrimitiveExpression(GetNameForAttribute(collectionContract.KeyName))));
1173
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.ValueNameProperty, new CodePrimitiveExpression(GetNameForAttribute(collectionContract.ValueName))));
1176
AddImportStatement(
Globals
.TypeOfCollectionDataContractAttribute.Namespace, contractCodeDomInfo.CodeNamespace);
1194
type.BaseTypes.Add(
Globals
.TypeOfObject);
1198
type.BaseTypes.Add(DataContract.GetClrTypeFullName(
Globals
.TypeOfIXmlSerializable));
1208
DataContract.GetClrTypeFullName(
Globals
.TypeOfXmlSchemaProviderAttribute),
1210
new CodeAttributeArgument(
Globals
.IsAnyProperty, new CodePrimitiveExpression(true)))
1216
DataContract.GetClrTypeFullName(
Globals
.TypeOfXmlSchemaProviderAttribute),
1217
new CodeAttributeArgument(new CodePrimitiveExpression(
Globals
.ExportSchemaMethod)))
1220
CodeMemberField typeNameField = new CodeMemberField(
Globals
.TypeOfXmlQualifiedName, s_typeNameFieldName);
1225
typeNameField.InitExpression = new CodeObjectCreateExpression(
Globals
.TypeOfXmlQualifiedName, new CodePrimitiveExpression(typeName.Name), new CodePrimitiveExpression(typeName.Namespace));
1235
CodeAttributeDeclaration xmlRootAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfXmlRootAttribute));
1276
CodeAttributeDeclaration namespaceAttribute = new CodeAttributeDeclaration(DataContract.GetClrTypeFullName(
Globals
.TypeOfContractNamespaceAttribute));
1278
namespaceAttribute.Arguments.Add(new CodeAttributeArgument(
Globals
.ClrNamespaceProperty, new CodePrimitiveExpression(clrNamespace)));
1287
memberName = GetClrIdentifier(memberName,
Globals
.DefaultGeneratedMember);
1290
memberName = AppendToValidClrIdentifier(memberName,
Globals
.DefaultMemberSuffix);
1380
uniqueNamespace = ((clrNamespace.Length == 0) ?
Globals
.DefaultClrNamespace : clrNamespace) + i.ToString(NumberFormatInfo.InvariantInfo);
1433
if (uriString.StartsWith(
Globals
.DataContractXsdBaseNamespace, StringComparison.Ordinal))
1434
AddToNamespace(builder, uriString.Substring(
Globals
.DataContractXsdBaseNamespace.Length), fragments);
1563
return CreateProperty(GetCodeTypeReference(
Globals
.TypeOfXmlNodeArray),
Globals
.NodeArrayPropertyName,
Globals
.NodeArrayFieldName, false/*isValueType*/);
1572
nodeArrayField.Type = GetCodeTypeReference(
Globals
.TypeOfXmlNodeArray);
1573
nodeArrayField.Name =
Globals
.NodeArrayFieldName;
1587
readXmlMethod.ImplementationTypes.Add(
Globals
.TypeOfIXmlSerializable);
1589
setNode.Left = new CodeFieldReferenceExpression(ThisReference,
Globals
.NodeArrayFieldName);
1591
new CodeTypeReferenceExpression(GetCodeTypeReference(
Globals
.TypeOfXmlSerializableServices)),
1609
writeXmlMethod.ImplementationTypes.Add(
Globals
.TypeOfIXmlSerializable);
1612
new CodeTypeReferenceExpression(GetCodeTypeReference(
Globals
.TypeOfXmlSerializableServices)),
1615
new CodePropertyReferenceExpression(ThisReference,
Globals
.NodeArrayPropertyName)
1629
getSchemaMethod.ImplementationTypes.Add(
Globals
.TypeOfIXmlSerializable);
1641
getSchemaStaticMethod.Name =
Globals
.ExportSchemaMethod;
1642
getSchemaStaticMethod.ReturnType = GetCodeTypeReference(
Globals
.TypeOfXmlQualifiedName);
1643
CodeParameterDeclarationExpression paramDeclaration = new CodeParameterDeclarationExpression(
Globals
.TypeOfXmlSchemaSet, "schemas");
1668
extensionDataObjectField.Type = GetCodeTypeReference(
Globals
.TypeOfExtensionDataObject);
1669
extensionDataObjectField.Name =
Globals
.ExtensionDataObjectFieldName;
1680
extensionDataObjectProperty.Type = GetCodeTypeReference(
Globals
.TypeOfExtensionDataObject);
1681
extensionDataObjectProperty.Name =
Globals
.ExtensionDataObjectPropertyName;
1683
extensionDataObjectProperty.ImplementationTypes.Add(
Globals
.TypeOfIExtensibleDataObject);
1686
propertyGet.Expression = new CodeFieldReferenceExpression(ThisReference,
Globals
.ExtensionDataObjectFieldName);
1690
propertySet.Left = new CodeFieldReferenceExpression(ThisReference,
Globals
.ExtensionDataObjectFieldName);
1724
propertyChangedEvent.ImplementationTypes.Add(
Globals
.TypeOfIPropertyChange);
1759
left = new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(
Globals
.TypeOfObject),
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (5)
62
s_objectEquals =
Globals
.TypeOfObject.GetMethod("Equals", BindingFlags.Public | BindingFlags.Static);
423
ConvertValue(type,
Globals
.TypeOfObject);
425
ConvertValue(type,
Globals
.TypeOfObject);
661
if (arrayType ==
Globals
.TypeOfArray)
1705
if (type !=
Globals
.TypeOfString)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (55)
603
Globals
.TypeOfIDictionaryGeneric,
604
Globals
.TypeOfIDictionary,
605
Globals
.TypeOfIListGeneric,
606
Globals
.TypeOfICollectionGeneric,
607
Globals
.TypeOfIList,
608
Globals
.TypeOfIEnumerableGeneric,
609
Globals
.TypeOfICollection,
610
Globals
.TypeOfIEnumerable
660
_keyName = keyName ??
Globals
.KeyLocalName;
661
_valueName = valueName ??
Globals
.ValueLocalName;
679
if (type ==
Globals
.TypeOfArray)
680
type =
Globals
.TypeOfObjectArray;
887
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfCollectionDataContractAttribute))
891
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfDataContractAttribute))
996
itemType =
Globals
.TypeOfObject;
1006
bool isBaseTypeCollection = (baseType != null && baseType !=
Globals
.TypeOfObject
1007
&& baseType !=
Globals
.TypeOfValueType && baseType !=
Globals
.TypeOfUri) ? IsCollection(baseType) : false;
1009
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfDataContractAttribute))
1015
if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type) || IsArraySegment(type))
1020
if (!
Globals
.TypeOfIEnumerable.IsAssignableFrom(type))
1037
if (interfaceTypeToCheck ==
Globals
.TypeOfIDictionaryGeneric)
1039
itemType =
Globals
.TypeOfKeyValue.MakeGenericType(genericArgs);
1040
addMethod = type.GetMethod(
Globals
.AddMethodName);
1041
getEnumeratorMethod =
Globals
.TypeOfIEnumerableGeneric.MakeGenericType(
Globals
.TypeOfKeyValuePair.MakeGenericType(genericArgs)).GetMethod(
Globals
.GetEnumeratorMethodName);
1048
var collectionType =
Globals
.TypeOfICollectionGeneric.MakeGenericType(itemType);
1051
addMethod = collectionType.GetMethod(
Globals
.AddMethodName);
1054
getEnumeratorMethod =
Globals
.TypeOfIEnumerableGeneric.MakeGenericType(itemType).GetMethod(
Globals
.GetEnumeratorMethodName);
1059
if (interfaceTypeToCheck ==
Globals
.TypeOfIDictionary)
1062
addMethod = type.GetMethod(
Globals
.AddMethodName);
1066
itemType =
Globals
.TypeOfObject;
1069
if (interfaceTypeToCheck ==
Globals
.TypeOfIList)
1071
addMethod = type.GetMethod(
Globals
.AddMethodName);
1075
getEnumeratorMethod =
Globals
.TypeOfIEnumerable.GetMethod(
Globals
.GetEnumeratorMethodName);
1129
knownInterfaceType =
Globals
.TypeOfIEnumerable;
1130
itemType = knownInterfaceType.GetTypeInfo().IsGenericType ? knownInterfaceType.GetGenericArguments()[0] :
Globals
.TypeOfObject;
1156
itemType = isOpenGeneric ?
Globals
.TypeOfKeyValue :
Globals
.TypeOfKeyValue.MakeGenericType(addMethodTypeArray);
1159
addMethodTypeArray = new Type[] {
Globals
.TypeOfObject,
Globals
.TypeOfObject };
1160
itemType =
Globals
.TypeOfKeyValue.MakeGenericType(addMethodTypeArray);
1168
itemType =
Globals
.TypeOfObject;
1191
return type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfCollectionDataContractAttribute);
1223
addMethod = t.GetMethod(
Globals
.AddMethodName) ?? addMethod;
1224
getEnumeratorMethod = t.GetMethod(
Globals
.GetEnumeratorMethodName) ?? getEnumeratorMethod;
1234
addMethod = type.GetMethod(
Globals
.AddMethodName, BindingFlags.Instance | BindingFlags.Public, addMethodTypeArray);
1258
addMethod = type.GetMethod(
Globals
.AddMethodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, addMethodTypeArray);
1265
getEnumeratorMethod = type.GetMethod(
Globals
.GetEnumeratorMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>());
1266
if (getEnumeratorMethod == null || !
Globals
.TypeOfIEnumerator.IsAssignableFrom(getEnumeratorMethod.ReturnType))
1270
ienumerableInterface =
Globals
.TypeOfIEnumerable;
1271
getEnumeratorMethod = GetTargetMethodWithName(
Globals
.GetEnumeratorMethodName, type, ienumerableInterface);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (48)
494
writer.WriteStartElement(
Globals
.SerPrefix, name, ns);
702
else if (
Globals
.TypeOfException.IsAssignableFrom(type))
704
else if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
706
else if (
Globals
.TypeOfScriptObject_IsAssignableFrom(type))
707
dataContract =
Globals
.CreateScriptObjectClassDataContract();
715
if (!IsTypeSerializable(type) && !type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfDataContractAttribute) && !ClassDataContract.IsNonAttributedTypeValidForSerialization(type) && !ClassDataContract.IsKnownSerializableType(type))
757
return type ==
Globals
.TypeOfDBNull || type.IsSerializable;
786
if (type ==
Globals
.TypeOfDateTimeOffset)
788
return
Globals
.TypeOfDateTimeOffsetAdapter;
791
if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValuePair)
793
return
Globals
.TypeOfKeyValuePairAdapter.MakeGenericType(type.GetGenericArguments());
801
if (
Globals
.TypeOfDateTimeOffset.TypeHandle.Equals(typeHandle))
803
return
Globals
.TypeOfDateTimeOffsetAdapter.TypeHandle;
811
type =
Globals
.TypeOfObject;
1009
else if (ns ==
Globals
.DataContractXmlNamespace)
1054
s_clrTypeStrings.Add(
Globals
.TypeOfInt.GetTypeInfo().Assembly.FullName, s_clrTypeStringsDictionary.Add(
Globals
.MscorlibAssemblyName));
1238
MethodInfo method = UnderlyingType.GetMethod(
Globals
.ParseMethodName, BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(string) });
1255
writer.WriteStartElement(
Globals
.SerPrefix, name, ns);
1291
type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfDataContractAttribute) ||
1295
type ==
Globals
.TypeOfDateTimeOffset ||
1296
type ==
Globals
.TypeOfDBNull ||
1297
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
1329
while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
1339
while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
1507
else if (
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type))
1538
.Where(a => a.AttributeType.FullName ==
Globals
.TypeOfDataContractAttribute.FullName)
1580
object[] collectionContractAttributes = type.GetTypeInfo().GetCustomAttributes(
Globals
.TypeOfCollectionDataContractAttribute, false).ToArray();
1613
string arrayOfPrefix =
Globals
.ArrayPrefix + GetArrayPrefix(ref itemType);
1628
arrayOfPrefix +=
Globals
.ArrayPrefix;
1639
GenericInfo genericInfo = new GenericInfo(DataContract.GetStableName(
Globals
.TypeOfNullable),
Globals
.TypeOfNullable.FullName);
1647
string name =
Globals
.ArrayPrefix + itemName.Name;
1653
return IsBuiltInNamespace(elementNs) ?
Globals
.CollectionsNamespace : elementNs;
1770
return (ns ==
Globals
.SchemaNamespace || ns ==
Globals
.SerializationNamespace);
1788
return new Uri(
Globals
.DataContractXsdBaseNamespaceUri, clrNs).AbsoluteUri;
1804
if (uri.ToString() ==
Globals
.SerializationNamespace)
1805
ThrowInvalidDataContractException(string.Format(SRSerialization.DataContractNamespaceReserved,
Globals
.SerializationNamespace), type);
1836
return uriString.StartsWith(
Globals
.DataContractXsdBaseNamespace, StringComparison.Ordinal) ? uriString.Substring(
Globals
.DataContractXsdBaseNamespace.Length) : uriString;
2055
type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable);
2076
object[] knownTypeAttributes = type.GetTypeInfo().GetCustomAttributes(
Globals
.TypeOfKnownTypeAttribute, false).ToArray();
2114
if (!
Globals
.TypeOfTypeEnumerable.IsAssignableFrom(method.ReturnType))
2142
collectionDataContract.ItemType.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValue)
2144
DataContract itemDataContract = DataContract.GetDataContract(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GetGenericArguments()));
2314
if (Regex.IsMatch(internalsVisibleAttributeAssemblyName,
Globals
.SimpleSRSInternalsVisiblePattern) ||
2315
Regex.IsMatch(internalsVisibleAttributeAssemblyName,
Globals
.FullSRSInternalsVisiblePattern))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSerializer.cs (1)
466
objType = obj != null ? obj.GetType() :
Globals
.TypeOfObject;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (6)
355
_referencedTypesDictionary.Add(DataContract.GetStableName(
Globals
.TypeOfNullable),
Globals
.TypeOfNullable);
384
XmlQualifiedName genericDictionaryName = DataContract.GetStableName(
Globals
.TypeOfDictionaryGeneric);
386
AddReferencedType(_referencedCollectionTypesDictionary,
Globals
.TypeOfDictionaryGeneric);
503
typeInfo.IsAttributeDefined(
Globals
.TypeOfDataContractAttribute) ||
504
(
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(type) && !typeInfo.IsGenericTypeDefinition) ||
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMember.cs (2)
191
_emitDefaultValue =
Globals
.DefaultEmitDefaultValue;
196
_emitDefaultValue =
Globals
.DefaultEmitDefaultValue;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMemberAttribute.cs (1)
14
private bool _emitDefaultValue =
Globals
.DefaultEmitDefaultValue;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DictionaryGlobals.cs (12)
73
SchemaInstanceNamespace = dictionary.Add(
Globals
.SchemaInstanceNamespace);
74
SerializationNamespace = dictionary.Add(
Globals
.SerializationNamespace);
75
SchemaNamespace = dictionary.Add(
Globals
.SchemaNamespace);
76
XsiTypeLocalName = dictionary.Add(
Globals
.XsiTypeLocalName);
77
XsiNilLocalName = dictionary.Add(
Globals
.XsiNilLocalName);
80
IdLocalName = dictionary.Add(
Globals
.IdLocalName);
81
RefLocalName = dictionary.Add(
Globals
.RefLocalName);
82
ArraySizeLocalName = dictionary.Add(
Globals
.ArraySizeLocalName);
85
XmlnsNamespace = dictionary.Add(
Globals
.XmlnsNamespace);
115
ClrTypeLocalName = dictionary.Add(
Globals
.ClrTypeLocalName);
116
ClrAssemblyLocalName = dictionary.Add(
Globals
.ClrAssemblyLocalName);
117
Space = dictionary.Add(
Globals
.Space);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (5)
174
XmlQualifiedName stableName = CreateQualifiedName(localName,
Globals
.SchemaNamespace);
196
IsFlags = type.GetTypeInfo().IsDefined(
Globals
.TypeOfFlagsAttribute, false);
268
_isULong = (baseType ==
Globals
.TypeOfULong);
285
object[] memberAttributes = field.GetCustomAttributes(
Globals
.TypeOfEnumMemberAttribute, false).ToArray();
305
object[] dataMemberAttributes = field.GetCustomAttributes(
Globals
.TypeOfDataMemberAttribute, false).ToArray();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (18)
153
Type baseType =
Globals
.TypeOfException;
156
if (baseType != null && baseType !=
Globals
.TypeOfObject && type !=
Globals
.TypeOfException)
254
if (type ==
Globals
.TypeOfException)
351
field.FieldType !=
Globals
.TypeOfObject; // Don't really know how to serialize plain System.Object instance
363
writer.WriteXmlnsAttribute("x", new XmlDictionary(1).Add(
Globals
.SchemaNamespace));
378
writer.WriteAttributeString(
Globals
.XsiPrefix, "type", null, "a:" + propDataContract.StableName.Name);
385
writer.WriteAttributeString(
Globals
.XsiPrefix, "nil", null, "true");
402
FieldInfo FieldFind =
Globals
.TypeOfException.GetField(key, BindingFlags.Instance | BindingFlags.NonPublic);
422
writer.WriteAttributeString(
Globals
.XsiPrefix, "type", null, "a:" + fieldDataContract.StableName.Name);
429
writer.WriteAttributeString(
Globals
.XsiPrefix, "nil", null, "true");
437
PropertyInfo[] props =
Globals
.TypeOfException.GetProperties();
470
Type exceptionType =
Globals
.TypeOfException;
474
DynamicMethod baseMessageImpl = new DynamicMethod("NonVirtual_Message", typeof(string), new Type[] {
Globals
.TypeOfException },
Globals
.TypeOfException);
545
if (primitiveContract == null || primitiveContract.UnderlyingType ==
Globals
.TypeOfObject)
548
writer.WriteAttributeString(
Globals
.XsiPrefix, "type", null, "x:" + primitiveContract.StableName.Name);
558
if (type ==
Globals
.TypeOfIDictionary)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataObject.cs (14)
99
private string _id =
Globals
.NewObjectId;
169
get { return (Id !=
Globals
.NewObjectId); }
185
AddQualifiedNameAttribute(element,
Globals
.XsiPrefix,
Globals
.XsiTypeLocalName,
Globals
.SchemaInstanceNamespace, DataContractName, DataContractNamespace);
187
element.AddAttribute(
Globals
.SerPrefix,
Globals
.SerializationNamespace,
Globals
.ClrTypeLocalName, ClrTypeName);
189
element.AddAttribute(
Globals
.SerPrefix,
Globals
.SerializationNamespace,
Globals
.ClrAssemblyLocalName, ClrAssemblyName);
209
if (attribute != null && attribute.prefix ==
Globals
.XmlnsPrefix && attribute.localName == prefix)
217
element.AddAttribute(
Globals
.XmlnsPrefix,
Globals
.XmlnsNamespace, prefix, valueNs);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataReader.cs (4)
59
AddPrefix(
Globals
.XsiPrefix,
Globals
.SchemaInstanceNamespace);
60
AddPrefix(
Globals
.SerPrefix,
Globals
.SerializationNamespace);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (9)
41
s_idQualifiedName = new XmlQualifiedName(
Globals
.IdLocalName,
Globals
.SerializationNamespace);
54
s_refQualifiedName = new XmlQualifiedName(
Globals
.RefLocalName,
Globals
.SerializationNamespace);
1062
Globals
.s_typeOfScriptObject = typeOfScriptObject;
1063
Globals
.s_serializeFunc = serializeFunc;
1064
Globals
.s_deserializeFunc = deserializeFunc;
1070
return
Globals
.s_serializeFunc(obj);
1076
return
Globals
.s_deserializeFunc(json);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\PrimitiveDataContract.cs (8)
100
_helper.XmlFormatWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
102
_helper.XmlFormatWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
120
_helper.XmlFormatContentWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { UnderlyingType });
122
_helper.XmlFormatContentWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName,
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType });
139
_helper.XmlFormatReaderMethod = typeof(XmlReaderDelegator).GetMethod(ReadMethodName,
Globals
.ScanAllMembers);
160
if (attributes.Ref !=
Globals
.NewObjectId)
860
writer.WriteStartElement(
Globals
.SerPrefix, name, ns);
862
writer.WriteStartElement(
Globals
.ElementPrefix, name, ns);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaExporter.cs (27)
36
object[] attrs = clrType.GetTypeInfo().GetCustomAttributes(
Globals
.TypeOfXmlSchemaProviderAttribute, false).ToArray();
62
if (!(
Globals
.TypeOfXmlQualifiedName.IsAssignableFrom(getMethod.ReturnType)))
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))));
117
if (type ==
Globals
.TypeOfXmlElement || type ==
Globals
.TypeOfXmlNodeArray)
120
if (type ==
Globals
.TypeOfXmlElement)
147
iSerializableWildcardElement.MaxOccursString =
Globals
.OccursUnbounded;
166
s_anytypeQualifiedName = new XmlQualifiedName(
Globals
.AnyTypeLocalName,
Globals
.SchemaNamespace);
183
s_stringQualifiedName = new XmlQualifiedName(
Globals
.StringLocalName,
Globals
.SchemaNamespace);
200
s_defaultEnumBaseTypeName = new XmlQualifiedName(
Globals
.IntLocalName,
Globals
.SchemaNamespace);
217
s_enumerationValueAnnotationName = new XmlQualifiedName(
Globals
.EnumerationValueLocalName,
Globals
.SerializationNamespace);
234
s_surrogateDataAnnotationName = new XmlQualifiedName(
Globals
.SurrogateDataLocalName,
Globals
.SerializationNamespace);
251
s_defaultValueAnnotation = new XmlQualifiedName(
Globals
.DefaultValueLocalName,
Globals
.SerializationNamespace);
268
s_actualTypeAnnotationName = new XmlQualifiedName(
Globals
.ActualTypeLocalName,
Globals
.SerializationNamespace);
285
s_isDictionaryAnnotationName = new XmlQualifiedName(
Globals
.IsDictionaryLocalName,
Globals
.SerializationNamespace);
302
s_isValueTypeName = new XmlQualifiedName(
Globals
.IsValueTypeLocalName,
Globals
.SerializationNamespace);
314
iSerializableFactoryTypeAttribute.RefName = new XmlQualifiedName(
Globals
.ISerializableFactoryTypeLocalName,
Globals
.SerializationNamespace);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (44)
50
if (!_schemaSet.Contains(
Globals
.SerializationNamespace))
52
StringReader reader = new StringReader(
Globals
.SerializationSchema);
55
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRSerialization.CouldNotReadSerializationSchema,
Globals
.SerializationNamespace)));
82
if (schema.TargetNamespace !=
Globals
.SerializationNamespace
83
&& schema.TargetNamespace !=
Globals
.SchemaNamespace)
144
element.Name =
Globals
.SchemaLocalName;
208
return dataContract is PrimitiveDataContract && ((PrimitiveDataContract)dataContract).UnderlyingType ==
Globals
.TypeOfObject;
250
if (schema.TargetNamespace !=
Globals
.SerializationNamespace)
512
if (
Globals
.TypeOfIXmlSerializable.GetTypeInfo().IsAssignableFrom(referencedType.GetTypeInfo()))
580
return (localElement.MaxOccursString ==
Globals
.OccursUnbounded || localElement.MaxOccurs > 1);
605
element.RefName.Namespace ==
Globals
.SerializationNamespace &&
610
XmlSchema serializationSchema = XmlSchema.Read(XmlReader.Create(new StringReader(
Globals
.SerializationSchema)), null);
755
&&
Globals
.TypeOfIXmlSerializable.IsAssignableFrom(referencedType))
762
return (XmlDataContract)DataContract.GetBuiltInDataContract(
Globals
.TypeOfXmlElement);
765
return (XmlDataContract)DataContract.GetBuiltInDataContract(
Globals
.TypeOfXmlNodeArray);
1005
memberEmitDefaultValue = emitDefaultValueFromAnnotation != null ? emitDefaultValueFromAnnotation.Value :
Globals
.DefaultEmitDefaultValue;
1011
if (prevMember.Order >
Globals
.DefaultOrder)
1033
XmlNode emitDefaultValueAttribute = defaultValueElement.Attributes.GetNamedItem(
Globals
.EmitDefaultValueAttribute);
1036
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.AnnotationAttributeNotFound, SchemaExporter.DefaultValueAnnotation.Name, typeName.Name, typeName.Namespace,
Globals
.EmitDefaultValueAttribute)));
1046
XmlNode nameAttribute = actualTypeElement.Attributes.GetNamedItem(
Globals
.ActualTypeNameAttribute);
1049
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace,
Globals
.ActualTypeNameAttribute)));
1050
XmlNode nsAttribute = actualTypeElement.Attributes.GetNamedItem(
Globals
.ActualTypeNamespaceAttribute);
1053
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace,
Globals
.ActualTypeNamespaceAttribute)));
1125
GenericInfo genericInfo = new GenericInfo(DataContract.GetStableName(
Globals
.TypeOfKeyValue),
Globals
.TypeOfKeyValue.FullName);
1141
genericInfo = new GenericInfo(DataContract.GetStableName(
Globals
.TypeOfNullable),
Globals
.TypeOfNullable.FullName);
1280
if (typeElement != null && typeElement.NamespaceURI ==
Globals
.SerializationNamespace)
1282
if (typeElement.LocalName ==
Globals
.GenericTypeLocalName)
1292
XmlNode nameAttribute = typeElement.Attributes.GetNamedItem(
Globals
.GenericNameAttribute);
1295
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.GenericAnnotationAttributeNotFound, type.Name,
Globals
.GenericNameAttribute)));
1296
XmlNode nsAttribute = typeElement.Attributes.GetNamedItem(
Globals
.GenericNamespaceAttribute);
1299
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.GenericAnnotationAttributeNotFound, type.Name,
Globals
.GenericNamespaceAttribute)));
1310
if (argumentElement.LocalName !=
Globals
.GenericParameterLocalName ||
1311
argumentElement.NamespaceURI !=
Globals
.SerializationNamespace)
1313
XmlNode nestedLevelAttribute = argumentElement.Attributes.GetNamedItem(
Globals
.GenericParameterNestedLevelAttribute);
1318
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.GenericAnnotationHasInvalidAttributeValue, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name, nestedLevelAttribute.Value, nestedLevelAttribute.LocalName,
Globals
.TypeOfInt.Name)));
1327
XmlNode typeNestedLevelsAttribute = typeElement.Attributes.GetNamedItem(
Globals
.GenericParameterNestedLevelAttribute);
1332
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.GenericAnnotationHasInvalidAttributeValue, typeElement.LocalName, typeElement.NamespaceURI, type.Name, typeNestedLevelsAttribute.Value, typeNestedLevelsAttribute.LocalName,
Globals
.TypeOfInt.Name)));
1346
DataContractSerializer serializer = new DataContractSerializer(
Globals
.TypeOfObject, dictionary.Add(name), dictionary.Add(DataContract.GetNamespace(ns)), knownTypes,
1390
if (TryCheckIfAttribute(typeName, attribute,
Globals
.IdQualifiedName, ref foundId))
1392
if (TryCheckIfAttribute(typeName, attribute,
Globals
.RefQualifiedName, ref foundRef))
1394
if (attribute.RefName.IsEmpty || attribute.RefName.Namespace !=
Globals
.SerializationNamespace || attribute.Use == XmlSchemaUse.Required)
1395
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, string.Format(SRSerialization.TypeShouldNotContainAttributes,
Globals
.SerializationNamespace));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (7)
207
return UnderlyingType ==
Globals
.TypeOfXmlElement || UnderlyingType ==
Globals
.TypeOfXmlNodeArray;
234
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfDataContractAttribute))
236
if (type.GetTypeInfo().IsAttributeDefined(
Globals
.TypeOfCollectionDataContractAttribute))
248
object[] xmlRootAttributes = (UnderlyingType == null) ? null : UnderlyingType.GetTypeInfo().GetCustomAttributes(
Globals
.TypeOfXmlRootAttribute, false).ToArray();
254
_topLevelElementNamespace = (this.StableName.Namespace ==
Globals
.SchemaNamespace) ? DictionaryGlobals.EmptyString : Namespace;
444
ilg.ConvertValue(this.UnderlyingType,
Globals
.TypeOfIXmlSerializable);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (66)
33
s_writeStartElementMethod2 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
49
s_writeStartElementMethod3 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(string), typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
65
s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement",
Globals
.ScanAllMembers, Array.Empty<Type>());
81
s_writeNamespaceDeclMethod = typeof(XmlWriterDelegator).GetMethod("WriteNamespaceDecl",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString) });
97
s_dictionaryEnumeratorCtor =
Globals
.TypeOfDictionaryEnumerator.GetConstructor(
Globals
.ScanAllMembers, new Type[] {
Globals
.TypeOfIDictionaryEnumerator });
143
s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract",
Globals
.ScanAllMembers).GetMethod;
159
s_isStartElementMethod2 = typeof(XmlReaderDelegator).GetMethod("IsStartElement",
Globals
.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) });
175
s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement",
Globals
.ScanAllMembers, Array.Empty<Type>());
191
s_getUninitializedObjectMethod = typeof(XmlFormatReaderGenerator).GetMethod("UnsafeGetUninitializedObject",
Globals
.ScanAllMembers, new Type[] { typeof(int) });
207
s_nodeTypeProperty = typeof(XmlReaderDelegator).GetProperty("NodeType",
Globals
.ScanAllMembers);
222
s_hashtableCtor =
Globals
.TypeOfHashtable.GetConstructor(
Globals
.ScanAllMembers, Array.Empty<Type>());
236
s_getStreamingContextMethod = typeof(XmlObjectSerializerContext).GetMethod("GetStreamingContext",
Globals
.ScanAllMembers);
252
s_getCollectionMemberMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetCollectionMember",
Globals
.ScanAllMembers);
268
s_storeCollectionMemberInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("StoreCollectionMemberInfo",
Globals
.ScanAllMembers, new Type[] { typeof(object) });
284
s_storeIsGetOnlyCollectionMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("StoreIsGetOnlyCollection",
Globals
.ScanAllMembers);
300
s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ThrowNullValueReturnedForGetOnlyCollectionException",
Globals
.ScanAllMembers);
315
s_throwArrayExceededSizeExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ThrowArrayExceededSizeException",
Globals
.ScanAllMembers);
331
s_incrementItemCountMethod = typeof(XmlObjectSerializerContext).GetMethod("IncrementItemCount",
Globals
.ScanAllMembers);
348
s_internalDeserializeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("InternalDeserialize",
Globals
.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(int), typeof(RuntimeTypeHandle), typeof(string), typeof(string) });
364
s_moveToNextElementMethod = typeof(XmlObjectSerializerReadContext).GetMethod("MoveToNextElement",
Globals
.ScanAllMembers);
380
s_getMemberIndexMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetMemberIndex",
Globals
.ScanAllMembers);
396
s_getMemberIndexWithRequiredMembersMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetMemberIndexWithRequiredMembers",
Globals
.ScanAllMembers);
412
s_throwRequiredMemberMissingExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ThrowRequiredMemberMissingException",
Globals
.ScanAllMembers);
428
s_skipUnknownElementMethod = typeof(XmlObjectSerializerReadContext).GetMethod("SkipUnknownElement",
Globals
.ScanAllMembers);
444
s_readIfNullOrRefMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadIfNullOrRef",
Globals
.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(Type), typeof(bool) });
460
s_readAttributesMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadAttributes",
Globals
.ScanAllMembers);
476
s_resetAttributesMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ResetAttributes",
Globals
.ScanAllMembers);
492
s_getObjectIdMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetObjectId",
Globals
.ScanAllMembers);
508
s_getArraySizeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetArraySize",
Globals
.ScanAllMembers);
524
s_addNewObjectMethod = typeof(XmlObjectSerializerReadContext).GetMethod("AddNewObject",
Globals
.ScanAllMembers);
540
s_addNewObjectWithIdMethod = typeof(XmlObjectSerializerReadContext).GetMethod("AddNewObjectWithId",
Globals
.ScanAllMembers);
556
s_getExistingObjectMethod = typeof(XmlObjectSerializerReadContext).GetMethod("GetExistingObject",
Globals
.ScanAllMembers);
572
s_ensureArraySizeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("EnsureArraySize",
Globals
.ScanAllMembers);
588
s_trimArraySizeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("TrimArraySize",
Globals
.ScanAllMembers);
604
s_checkEndOfArrayMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CheckEndOfArray",
Globals
.ScanAllMembers);
621
s_getArrayLengthMethod =
Globals
.TypeOfArray.GetProperty("Length").GetMethod;
637
s_createSerializationExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CreateSerializationException",
Globals
.ScanAllMembers, new Type[] { typeof(string) });
653
s_createUnexpectedStateExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CreateUnexpectedStateException",
Globals
.ScanAllMembers, new Type[] { typeof(XmlNodeType), typeof(XmlReaderDelegator) });
669
s_internalSerializeReferenceMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("InternalSerializeReference",
Globals
.ScanAllMembers);
685
s_internalSerializeMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("InternalSerialize",
Globals
.ScanAllMembers);
701
s_writeNullMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("WriteNull",
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(Type), typeof(bool) });
717
s_incrementArrayCountMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementArrayCount",
Globals
.ScanAllMembers);
733
s_incrementCollectionCountMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementCollectionCount",
Globals
.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(ICollection) });
749
s_incrementCollectionCountGenericMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementCollectionCountGeneric",
Globals
.ScanAllMembers);
765
s_getDefaultValueMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("GetDefaultValue",
Globals
.ScanAllMembers);
781
s_getNullableValueMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("GetNullableValue",
Globals
.ScanAllMembers);
797
s_throwRequiredMemberMustBeEmittedMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("ThrowRequiredMemberMustBeEmitted",
Globals
.ScanAllMembers);
813
s_getHasValueMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("GetHasValue",
Globals
.ScanAllMembers);
831
s_isMemberTypeSameAsMemberValue = typeof(XmlObjectSerializerWriteContext).GetMethod("IsMemberTypeSameAsMemberValue",
Globals
.ScanAllMembers, new Type[] { typeof(object), typeof(Type) });
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);
895
s_contractNamespacesField = typeof(ClassDataContract).GetField("ContractNamespaces",
Globals
.ScanAllMembers);
911
s_memberNamesField = typeof(ClassDataContract).GetField("MemberNames",
Globals
.ScanAllMembers);
927
s_childElementNamespacesProperty = typeof(ClassDataContract).GetProperty("ChildElementNamespaces",
Globals
.ScanAllMembers);
943
s_collectionItemNameProperty = typeof(CollectionDataContract).GetProperty("CollectionItemName",
Globals
.ScanAllMembers);
959
s_childElementNamespaceProperty = typeof(CollectionDataContract).GetProperty("ChildElementNamespace",
Globals
.ScanAllMembers);
975
s_getDateTimeOffsetMethod = typeof(DateTimeOffsetAdapter).GetMethod("GetDateTimeOffset",
Globals
.ScanAllMembers);
991
s_getDateTimeOffsetAdapterMethod = typeof(DateTimeOffsetAdapter).GetMethod("GetDateTimeOffsetAdapter",
Globals
.ScanAllMembers);
1036
s_throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException",
Globals
.ScanAllMembers, new Type[] { typeof(string), typeof(Type) });
1052
s_serializeReadOnlyTypesProperty = typeof(XmlObjectSerializerWriteContext).GetProperty("SerializeReadOnlyTypes",
Globals
.ScanAllMembers);
1068
s_classSerializationExceptionMessageProperty = typeof(ClassDataContract).GetProperty("SerializationExceptionMessage",
Globals
.ScanAllMembers);
1084
s_collectionSerializationExceptionMessageProperty = typeof(CollectionDataContract).GetProperty("SerializationExceptionMessage",
Globals
.ScanAllMembers);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (35)
95
_ilg.BeginMethod("Read" + classContract.StableName.Name + "FromXml",
Globals
.TypeOfXmlFormatClassReaderDelegate, memberAccessFlag);
125
if (classContract.UnderlyingType ==
Globals
.TypeOfDateTimeOffsetAdapter)
127
_ilg.ConvertValue(_objectLocal.LocalType,
Globals
.TypeOfDateTimeOffsetAdapter);
129
_ilg.ConvertValue(
Globals
.TypeOfDateTimeOffset, _ilg.CurrentMethod.ReturnType);
135
_ilg.ConvertValue(
Globals
.TypeOfKeyValuePair.MakeGenericType(classContract.KeyValuePairGenericArguments), _ilg.CurrentMethod.ReturnType);
169
_ilg.BeginMethod("Read" + collectionContract.StableName.Name + "FromXml" + "IsGetOnly",
Globals
.TypeOfXmlFormatGetOnlyCollectionReaderDelegate, memberAccessFlag);
173
_ilg.BeginMethod("Read" + collectionContract.StableName.Name + "FromXml" + string.Empty,
Globals
.TypeOfXmlFormatCollectionReaderDelegate, memberAccessFlag);
205
type =
Globals
.TypeOfValueType;
209
if (classContract.UnderlyingType ==
Globals
.TypeOfDBNull)
211
_ilg.LoadMember(
Globals
.TypeOfDBNull.GetField("Value"));
230
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
274
LocalBuilder memberIndexLocal = _ilg.DeclareLocal(
Globals
.TypeOfInt, "memberIndex", -1);
279
LocalBuilder requiredIndexLocal = hasRequiredMembers ? _ilg.DeclareLocal(
Globals
.TypeOfInt, "requiredIndex", firstRequiredMember) : null;
384
while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
391
if ((primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject) || nullables != 0 || type.GetTypeInfo().IsValueType)
393
LocalBuilder objectId = _ilg.DeclareLocal(
Globals
.TypeOfString, "objectIdRead");
398
_ilg.If(objectId, Cmp.EqualTo,
Globals
.NullObjectId);
430
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject)
448
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
455
_ilg.If(objectId, Cmp.NotEqualTo,
Globals
.NullObjectId);
480
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
491
Type type =
Globals
.TypeOfNullable.MakeGenericType(innerType);
511
type =
Globals
.TypeOfDictionaryGeneric.MakeGenericType(itemType.GetGenericArguments());
515
type =
Globals
.TypeOfHashtable;
548
LocalBuilder size = _ilg.DeclareLocal(
Globals
.TypeOfInt, "arraySize");
552
LocalBuilder objectId = _ilg.DeclareLocal(
Globals
.TypeOfString, "objectIdRead");
572
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt, "i");
613
LocalBuilder j = _ilg.DeclareLocal(
Globals
.TypeOfInt, "j");
648
_ilg.ConvertValue(
Globals
.TypeOfObject, type);
658
LocalBuilder size = _ilg.DeclareLocal(
Globals
.TypeOfInt, "arraySize");
668
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt, "i");
740
_ilg.Call(typeof(XmlReaderDelegator).GetMethod(readArrayMethod,
Globals
.ScanAllMembers));
757
_ilg.ConvertValue(
Globals
.TypeOfObject, itemType);
788
if (collectionContract.AddMethod.ReturnType !=
Globals
.TypeOfVoid)
794
if (collectionContract.AddMethod.ReturnType !=
Globals
.TypeOfVoid)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (37)
86
_ilg.BeginMethod("Write" + classContract.StableName.Name + "ToXml",
Globals
.TypeOfXmlFormatClassWriterDelegate, memberAccessFlag);
110
_ilg.BeginMethod("Write" + collectionContract.StableName.Name + "ToXml",
Globals
.TypeOfXmlFormatCollectionWriterDelegate, memberAccessFlag);
142
if (objType ==
Globals
.TypeOfDateTimeOffsetAdapter)
144
_ilg.ConvertValue(objectArg.ArgType,
Globals
.TypeOfDateTimeOffset);
148
else if (objType.GetTypeInfo().IsGenericType && objType.GetGenericTypeDefinition() ==
Globals
.TypeOfKeyValuePairAdapter)
151
_ilg.ConvertValue(objectArg.ArgType,
Globals
.TypeOfKeyValuePair.MakeGenericType(dc.KeyValuePairGenericArguments));
317
LocalBuilder i = _ilg.DeclareLocal(
Globals
.TypeOfInt, "i");
351
incrementCollectionCountMethod = XmlFormatGeneratorStatics.IncrementCollectionCountGenericMethod.MakeGenericMethod(
Globals
.TypeOfKeyValuePair.MakeGenericType(collectionContract.ItemType.GetGenericArguments()));
366
enumeratorType =
Globals
.TypeOfGenericDictionaryEnumerator.MakeGenericType(keyValueTypes);
371
keyValueTypes = new Type[] {
Globals
.TypeOfObject,
Globals
.TypeOfObject };
372
enumeratorType =
Globals
.TypeOfDictionaryEnumerator;
378
MethodInfo moveNextMethod = enumeratorType.GetMethod(
Globals
.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>());
379
MethodInfo getCurrentMethod = enumeratorType.GetMethod(
Globals
.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>());
391
Type ienumeratorInterface =
Globals
.TypeOfIEnumerator;
399
&& interfaceType.GetGenericTypeDefinition() ==
Globals
.TypeOfIEnumeratorGeneric
408
moveNextMethod = CollectionDataContract.GetTargetMethodWithName(
Globals
.MoveNextMethodName, enumeratorType, ienumeratorInterface);
410
getCurrentMethod = CollectionDataContract.GetTargetMethodWithName(
Globals
.GetCurrentMethodName, enumeratorType, ienumeratorInterface);
420
_ilg.ConvertValue(collectionContract.GetEnumeratorMethod.ReturnType,
Globals
.TypeOfIDictionaryEnumerator);
425
Type ctorParam =
Globals
.TypeOfIEnumeratorGeneric.MakeGenericType(
Globals
.TypeOfKeyValuePair.MakeGenericType(keyValueTypes));
426
ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(
Globals
.ScanAllMembers, new Type[] { ctorParam });
446
_ilg.ConvertValue(currentValue.LocalType,
Globals
.TypeOfObject);
463
if (primitiveContract == null || primitiveContract.UnderlyingType ==
Globals
.TypeOfObject)
545
_ilg.Call(typeof(XmlWriterDelegator).GetMethod(writeArrayMethod,
Globals
.ScanAllMembers, new Type[] { type, typeof(XmlDictionaryString), typeof(XmlDictionaryString) }));
555
memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable);
581
if (primitiveContract != null && primitiveContract.UnderlyingType !=
Globals
.TypeOfObject && !writeXsiType)
594
if (memberType ==
Globals
.TypeOfObject ||//boxed Nullable<T>
595
memberType ==
Globals
.TypeOfValueType ||
596
((IList)
Globals
.TypeOfNullable.GetInterfaces()).Contains(memberType))
599
_ilg.ConvertValue(memberValue.LocalType,
Globals
.TypeOfObject);
600
memberValue = _ilg.DeclareLocal(
Globals
.TypeOfObject, "unwrappedMemberValue");
610
if (memberType ==
Globals
.TypeOfObject) //boxed Nullable<T>
622
_ilg.ConvertValue(memberValue.LocalType,
Globals
.TypeOfObject);
640
while (memberType.GetTypeInfo().IsGenericType && memberType.GetGenericTypeDefinition() ==
Globals
.TypeOfNullable)
664
return type ==
Globals
.TypeOfXmlQualifiedName && (ns != null && ns.Value != null && ns.Value.Length > 0);
673
_ilg.Load(
Globals
.ElementPrefix);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializer.cs (2)
212
writer.WriteAttributeBool(
Globals
.XsiPrefix, DictionaryGlobals.XsiNilLocalName, DictionaryGlobals.SchemaInstanceNamespace, true);
345
DataContract objectContract = PrimitiveDataContract.GetPrimitiveDataContract(
Globals
.TypeOfObject);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (9)
130
if (attributes.Ref !=
Globals
.NewObjectId)
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))));
336
if (attributes.Ref !=
Globals
.NewObjectId)
346
return
Globals
.NullObjectId;
348
return
Globals
.NewObjectId;
405
if (id !=
Globals
.NewObjectId)
414
if (id !=
Globals
.NewObjectId)
539
if (xmlDataContract.UnderlyingType ==
Globals
.TypeOfXmlElement)
546
else if (xmlDataContract.UnderlyingType ==
Globals
.TypeOfXmlNodeArray)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (6)
110
throw XmlObjectSerializer.CreateSerializationException(XmlObjectSerializer.TryAddLineInfo(xmlReader, string.Format(SRSerialization.AttributeNotFound,
Globals
.SerializationNamespace,
Globals
.ClrTypeLocalName, xmlReader.NodeType, xmlReader.NamespaceURI, xmlReader.LocalName)));
112
throw XmlObjectSerializer.CreateSerializationException(XmlObjectSerializer.TryAddLineInfo(xmlReader, string.Format(SRSerialization.AttributeNotFound,
Globals
.SerializationNamespace,
Globals
.ClrAssemblyLocalName, xmlReader.NodeType, xmlReader.NamespaceURI, xmlReader.LocalName)));
114
throw XmlObjectSerializer.CreateSerializationException(XmlObjectSerializer.TryAddLineInfo(xmlReader, string.Format(SRSerialization.AttributeNotFound,
Globals
.SerializationNamespace,
Globals
.ClrTypeLocalName, xmlReader.NodeType, xmlReader.NamespaceURI, xmlReader.LocalName)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (7)
117
Type declaredType =
Globals
.TypeOfObject;
245
xmlWriter.WriteAttributeString(
Globals
.SerPrefix, DictionaryGlobals.IdLocalName,
251
xmlWriter.WriteAttributeString(
Globals
.SerPrefix, DictionaryGlobals.RefLocalName, DictionaryGlobals.SerializationNamespace, string.Format(CultureInfo.InvariantCulture, "{0}{1}", "i", objectId));
401
xmlWriter.WriteStartElement(
Globals
.ElementPrefix, name, ns);
411
writer.WriteXmlnsAttribute(
Globals
.XsiPrefix, DictionaryGlobals.SchemaInstanceNamespace);
642
writer.WriteAttributeQualifiedName(
Globals
.XsiPrefix, DictionaryGlobals.XsiTypeLocalName, DictionaryGlobals.SchemaInstanceNamespace, dataContractName, dataContractNamespace);
647
writer.WriteAttributeQualifiedName(
Globals
.XsiPrefix, DictionaryGlobals.XsiTypeLocalName, DictionaryGlobals.SchemaInstanceNamespace, dataContractName, dataContractNamespace);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (6)
168
xmlWriter.WriteStartElement(
Globals
.ElementPrefix, name, ns);
196
xmlWriter.WriteAttributeInt(
Globals
.SerPrefix, DictionaryGlobals.IdLocalName, DictionaryGlobals.SerializationNamespace, objectId);
199
xmlWriter.WriteAttributeInt(
Globals
.SerPrefix, DictionaryGlobals.RefLocalName, DictionaryGlobals.SerializationNamespace, objectId);
200
xmlWriter.WriteAttributeBool(
Globals
.XsiPrefix, DictionaryGlobals.XsiNilLocalName, DictionaryGlobals.SchemaInstanceNamespace, true);
268
declaredType =
Globals
.TypeOfObject;
287
xmlWriter.WriteAttributeInt(
Globals
.SerPrefix, DictionaryGlobals.ArraySizeLocalName, DictionaryGlobals.SerializationNamespace, size);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlSerializableServices.cs (2)
52
return xmlReader.NamespaceURI !=
Globals
.SerializationNamespace &&
53
xmlReader.NamespaceURI !=
Globals
.SchemaInstanceNamespace &&
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (6)
350
if (valueType ==
Globals
.TypeOfByteArray)
352
else if (valueType ==
Globals
.TypeOfObject)
356
else if (valueType ==
Globals
.TypeOfTimeSpan)
358
else if (valueType ==
Globals
.TypeOfGuid)
360
else if (valueType ==
Globals
.TypeOfUri)
362
else if (valueType ==
Globals
.TypeOfXmlQualifiedName)