11 writes to XmlName
System.Private.DataContractSerialization (11)
System\Runtime\Serialization\ClassDataContract.cs (1)
1365
boundClassContract.
XmlName
= CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(xmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), genericParams)), xmlName.Namespace);
System\Runtime\Serialization\CollectionDataContract.cs (1)
1405
boundCollectionContract.
XmlName
= CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(XmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), paramContracts)),
System\Runtime\Serialization\DataContract.cs (1)
487
dataContract.
XmlName
= originalDataContract.XmlName;
System\Runtime\Serialization\EnumDataContract.cs (2)
133
_baseContract.
XmlName
= baseTypeName;
175
_baseContract.
XmlName
= value;
System\Runtime\Serialization\SchemaImporter.cs (6)
656
dataContract.
XmlName
= typeName;
707
xmlDataContract.
XmlName
= typeName;
826
dataContract.
XmlName
= typeName;
1052
dataContract.
XmlName
= typeName;
1126
dataContract.ItemContract.
XmlName
= new XmlQualifiedName(genericInfo.GetExpandedXmlName().Name, typeName.Namespace);
1196
dataContract.
XmlName
= typeName;
169 references to XmlName
System.Private.DataContractSerialization (113)
System\Runtime\Serialization\ClassDataContract.cs (4)
991
membersInHierarchy.Add(new Member(member, currContract.
XmlName
!.Namespace, baseTypeIndex));
1151
ThrowInvalidDataContractException(SR.Format(SR.ValueTypeCannotHaveBaseType, XmlName!.Name, XmlName.Namespace, _baseContract.
XmlName
!.Name, _baseContract.
XmlName
.Namespace));
1330
xmlName =
XmlName
;
System\Runtime\Serialization\CollectionDataContract.cs (6)
533
XmlName = CreateQualifiedName(Globals.ArrayPrefix + itemContract.
XmlName
.Name, itemContract.
XmlName
.Namespace);
1402
boundCollectionContract.ItemName = ItemNameSetExplicit ? ItemName : boundCollectionContract.ItemContract.
XmlName
.Name;
1405
boundCollectionContract.XmlName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(
XmlName
.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), paramContracts)),
1406
IsCollectionDataContract(UnderlyingType) ?
XmlName
.Namespace : DataContract.GetCollectionNamespace(boundCollectionContract.ItemContract.
XmlName
.Namespace));
System\Runtime\Serialization\DataContract.cs (18)
484
if (dataContract.
XmlName
!= originalDataContract.
XmlName
)
487
dataContract.XmlName = originalDataContract.
XmlName
;
1322
xmlName = builtInContract.
XmlName
;
1436
genericInfo.Add(new GenericInfo(
XmlName
, null));
1442
itemName =
XmlName
;
1604
localName = dataContract.
XmlName
.Name;
1605
ns = dataContract.
XmlName
.Namespace;
2030
knownDataContracts.TryAdd(itemDataContract.
XmlName
, itemDataContract);
2056
else if (nameToDataContractTable.TryGetValue(dataContract.
XmlName
, out DataContract? alreadyExistingContract))
2061
throw new InvalidOperationException(SR.Format(SR.DupContractInKnownTypes, type, alreadyExistingContract.UnderlyingType, dataContract.
XmlName
.Namespace, dataContract.
XmlName
.Name));
2064
nameToDataContractTable.Add(dataContract.
XmlName
, dataContract);
2079
return (
XmlName
.Name == dataContract.
XmlName
.Name &&
XmlName
.Namespace == dataContract.
XmlName
.Namespace && IsReference == dataContract.IsReference);
2352
_genericParams[i] = qname = ((DataContract)o).
XmlName
;
System\Runtime\Serialization\DataContractSet.cs (12)
91
Add(dataContract.
XmlName
, dataContract);
112
throw new InvalidOperationException(SR.Format(SR.DupContractInDataContractSet, dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace));
116
throw new InvalidOperationException(SR.Format(SR.DupTypeContractInDataContractSet, (typeNamesEqual ? dataContract.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), (typeNamesEqual ? dataContractInSet.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)), dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace));
145
Add(classDataContract.BaseClassContract.
XmlName
, classDataContract.BaseClassContract);
166
Add(memberDataContract.
XmlName
, memberDataContract);
188
Add(itemContract.
XmlName
, itemContract);
450
if (genericXmlName != dataContract.
XmlName
)
451
throw new InvalidDataContractException(SR.Format(SR.GenericTypeNameMismatch, dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, genericXmlName.Name, genericXmlName.Namespace));
550
xmlName = SchemaImporter.ImportActualType(xmlDataContract.XsdType?.Annotation, xmlName, dataContract.
XmlName
);
System\Runtime\Serialization\EnumDataContract.cs (1)
162
get => _baseContract.
XmlName
;
System\Runtime\Serialization\Json\JsonDataContract.cs (2)
293
_knownDataContracts.TryAdd(itemContract.
XmlName
, itemContract);
299
_knownDataContracts.TryAdd(itemDataContract.
XmlName
, itemDataContract);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (3)
70
BeginMethod(_ilg, "Read" + DataContract.SanitizeTypeName(classContract.
XmlName
!.Name) + "FromJson", typeof(JsonFormatClassReaderDelegate), memberAccessFlag);
154
BeginMethod(_ilg, "Read" + DataContract.SanitizeTypeName(collectionContract.
XmlName
.Name) + "FromJson" + "IsGetOnly", typeof(JsonFormatGetOnlyCollectionReaderDelegate), memberAccessFlag);
158
BeginMethod(_ilg, "Read" + DataContract.SanitizeTypeName(collectionContract.
XmlName
.Name) + "FromJson", typeof(JsonFormatCollectionReaderDelegate), memberAccessFlag);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (2)
63
BeginMethod(_ilg, "Write" + DataContract.SanitizeTypeName(classContract.
XmlName
.Name) + "ToJson", typeof(JsonFormatClassWriterDelegate), memberAccessFlag);
90
BeginMethod(_ilg, "Write" + DataContract.SanitizeTypeName(collectionContract.
XmlName
.Name) + "ToJson", typeof(JsonFormatCollectionWriterDelegate), memberAccessFlag);
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (4)
275
throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace));
405
if (rootTypeDataContract.
XmlName
== typeQName)
421
if (itemContract.
XmlName
== typeQName)
System\Runtime\Serialization\ReflectionReader.cs (1)
239
var value = ReflectionReadValue(xmlReader, context, dataMember, classContract.
XmlName
.Namespace);
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (2)
109
return classContract.
XmlName
!.Namespace;
119
return collectionContract.
XmlName
.Namespace;
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (2)
238
string? ns = classContract.
XmlName
.Namespace;
242
if (ns == currentContract.
XmlName
.Namespace)
System\Runtime\Serialization\SchemaExporter.cs (13)
86
XmlSchema schema = GetSchema(dataContract.
XmlName
.Namespace);
106
if (schema == null || dataContract.
XmlName
.Namespace != dataContract.TopLevelElementNamespace!.Value)
122
type.Name = classDataContract.
XmlName
.Name;
140
actualTypeElement = ExportActualType(memberTypeContract.
XmlName
);
141
SchemaHelper.AddSchemaImport(memberTypeContract.
XmlName
.Namespace, schema);
158
XmlSchemaComplexContentExtension extension = CreateTypeContent(type, classDataContract.BaseClassContract.
XmlName
, schema);
192
element.SchemaTypeName = dataContract.
XmlName
;
197
SchemaHelper.AddSchemaImport(dataContract.
XmlName
.Namespace, schema);
364
type.Name = collectionDataContract.
XmlName
.Name;
426
type.Name = enumDataContract.
XmlName
.Name;
467
type.Name = dataContract.
XmlName
.Name;
476
_ = CreateTypeContent(type, dataContract.BaseClassContract.
XmlName
, schema);
518
if (!(typeQName.Equals(dataContract.
XmlName
)))
System\Runtime\Serialization\SchemaImporter.cs (18)
110
elementNameList.Add(ImportType(typeName).
XmlName
);
117
elementNameList.Add(ImportAnonymousElement(element, element.QualifiedName).
XmlName
);
121
elementNameList.Add(ImportAnonymousGlobalElement(element, element.QualifiedName, schema.TargetNamespace).
XmlName
);
230
if (!knownDataContracts.TryGetValue(dataContract.
XmlName
, out _))
232
knownDataContracts.Add(dataContract.
XmlName
, dataContract);
558
return (baseContract.
XmlName
== expectedBase || baseContract is EnumDataContract);
670
ThrowTypeCannotBeImportedException(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, SR.Format(SR.DerivedTypeNotISerializable, baseTypeName.Name, baseTypeName.Namespace));
838
ThrowISerializableTypeCannotBeImportedException(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, SR.Format(SR.BaseTypeNotISerializable, baseTypeName.Name, baseTypeName.Namespace));
903
ThrowTypeCannotBeImportedException(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, SR.Format(dataContract.IsISerializable ? SR.InvalidISerializableDerivation : SR.InvalidClassDerivation, baseTypeName.Name, baseTypeName.Namespace));
913
knownDataContracts.Add(dataContract.
XmlName
, dataContract);
946
XmlQualifiedName typeName = dataContract.
XmlName
;
1120
_dataContractSet.Remove(keyValueContract.
XmlName
);
1141
genericInfo.Add(new GenericInfo(dataMember.MemberTypeContract.
XmlName
, null));
1145
genericInfo = new GenericInfo(dataMember.MemberTypeContract.
XmlName
, null);
1407
_dataContractSet.Add(dataContract.
XmlName
, dataContract);
System\Runtime\Serialization\XmlDataContract.cs (4)
401
return (
XmlName
.Name == dataContract.
XmlName
.Name &&
XmlName
.Namespace == dataContract.
XmlName
.Namespace);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (7)
92
_ilg.BeginMethod("Read" + classContract.
XmlName
.Name + "FromXml", Globals.TypeOfXmlFormatClassReaderDelegate, memberAccessFlag);
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);
446
ReadValue(memberType, dataMember.Name, classContract.
XmlName
.Namespace);
451
value = ReadValue(memberType, dataMember.Name, classContract.
XmlName
.Namespace);
665
string itemNs = collectionContract.
XmlName
.Namespace;
781
string itemNs = collectionContract.
XmlName
.Namespace;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
86
_ilg.BeginMethod("Write" + classContract.
XmlName
.Name + "ToXml", Globals.TypeOfXmlFormatClassWriterDelegate, memberAccessFlag);
130
_ilg.BeginMethod("Write" + collectionContract.
XmlName
.Name + "ToXml", Globals.TypeOfXmlFormatCollectionWriterDelegate, memberAccessFlag);
798
string ns = classContract.
XmlName
.Namespace;
802
if (ns == currentContract.
XmlName
.Namespace)
System\Runtime\Serialization\XmlObjectSerializerContext.cs (5)
230
DataContract? knownContract = ResolveDataContractFromKnownTypes(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, null /*memberTypeContract*/, declaredType);
268
&& memberTypeContract.
XmlName
== qname)
274
if (rootTypeDataContract.
XmlName
== qname)
291
if (itemContract.
XmlName
== typeQName)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (4)
245
DataContract? knownContract = ResolveDataContractFromKnownTypes(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, null /*memberTypeContract*/, declaredType);
248
throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace));
System\Runtime\Serialization\XsdDataContractExporter.cs (1)
198
return dataContract.
XmlName
;
System.Runtime.Serialization.Schema (56)
System\Runtime\Serialization\Schema\CodeExporter.cs (56)
62
_clrNamespaces.Add(clrNamespace, dataContract.
XmlName
.Namespace);
63
_namespaces.Add(dataContract.
XmlName
.Namespace, clrNamespace);
226
ExportClassDataContractHierarchy(dataContract.
XmlName
, dataContract, contractCodeDomInfo, new Dictionary<XmlQualifiedName, object?>());
264
if (contractNamesInHierarchy.ContainsKey(classContract.
XmlName
))
265
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.Format(SR.TypeCannotBeImported, typeName.Name, typeName.Namespace, SR.Format(SR.CircularTypeReference, classContract.
XmlName
.Name, classContract.
XmlName
.Namespace))));
266
contractNamesInHierarchy.Add(classContract.
XmlName
, null);
424
CodeNamespace ns = GetCodeNamespace(clrNamespace, dataContract.
XmlName
.Namespace, contractCodeDomInfo);
428
string typeName = XmlConvert.DecodeName(dataContract.
XmlName
.Name);
473
string originalName = dataContract.
XmlName
.Name;
478
DataContract? containingDataContract = _dataContractSet.GetDataContract(new XmlQualifiedName(containingTypeName, dataContract.
XmlName
.Namespace));
541
Type? type = _dataContractSet.GetReferencedType(dataContract.
XmlName
, dataContract, out DataContract? referencedContract, out object[]? parameters, SupportsGenericTypeReference);
551
throw ExceptionUtil.ThrowHelperError(new InvalidOperationException(SR.Format(SR.ReferencedTypeDoesNotMatch, type.AssemblyQualifiedName, dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace)));
560
throw ExceptionUtil.ThrowHelperError(new InvalidDataContractException(SR.Format(SR.TypeMustBeIXmlSerializable, GetClrTypeFullName(type), GetClrTypeFullName(typeof(IXmlSerializable)), dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace)));
569
throw ExceptionUtil.ThrowHelperError(new InvalidOperationException(SR.Format(SR.ReferencedTypeDoesNotMatch, type.AssemblyQualifiedName, dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace)));
581
referencedContract.
XmlName
.Name,
582
referencedContract.
XmlName
.Namespace)));
636
if (itemName != itemContract.
XmlName
.Name)
643
return (collectionContract.
XmlName
.Name == expectedType.Name && collectionContract.
XmlName
.Namespace == expectedType.Namespace);
716
if (DataContract.GetBuiltInDataContract(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace) == null)
717
type = surrogateProvider.GetReferencedTypeOnImport(dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, _dataContractSet.SurrogateData[dataContract]);
797
string dataContractName = GetNameForAttribute(classDataContract.
XmlName
.Name);
800
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NamespaceProperty, new CodePrimitiveExpression(classDataContract.
XmlName
.Namespace)));
977
if (classDataContract.
XmlName
!= pair.Key && !classDataContract.KnownDataContracts.ContainsKey(pair.Key) && !pair.Value.IsBuiltInDataContract)
1054
throw ExceptionUtil.ThrowHelperError(new InvalidOperationException(SR.Format(SR.CannotDeriveFromSealedReferenceType, dataContract.
XmlName
.Name, dataContract.
XmlName
.Namespace, GetClrTypeFullName(baseType))));
1080
string dataContractName = GetNameForAttribute(enumDataContract.
XmlName
.Name);
1083
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NamespaceProperty, new CodePrimitiveExpression(enumDataContract.
XmlName
.Namespace)));
1115
if (SchemaImportHelper.GetDefaultXmlNamespace(contractCodeDomInfo.ClrNamespace) != classDataContract.
XmlName
.Namespace)
1116
throw ExceptionUtil.ThrowHelperError(new InvalidDataContractException(SR.Format(SR.InvalidClrNamespaceGeneratedForISerializable, classDataContract.
XmlName
.Name, classDataContract.
XmlName
.Namespace, SchemaImportHelper.GetDataContractNamespaceFromUri(classDataContract.
XmlName
.Namespace), contractCodeDomInfo.ClrNamespace)));
1118
string dataContractName = GetNameForAttribute(classDataContract.
XmlName
.Name);
1126
throw ExceptionUtil.ThrowHelperError(new InvalidDataContractException(SR.Format(SR.InvalidClrNameGeneratedForISerializable, classDataContract.
XmlName
.Name, classDataContract.
XmlName
.Namespace, contractCodeDomInfo.TypeDeclaration.Name)));
1173
if (keyValueContract != null && _dataContractSet.GetDataContract(keyValueContract.
XmlName
) == null)
1197
string dataContractName = GetNameForAttribute(collectionContract.
XmlName
.Name);
1203
collectionContract.
XmlName
.Namespace)));
1227
string expectedTypeName = ImportGlobals.ArrayPrefix + itemContract.
XmlName
.Name;
1228
string expectedTypeNs = SchemaImportHelper.GetCollectionNamespace(itemContract.
XmlName
.Namespace);
1230
dataContractName, collectionContract.
XmlName
.Namespace,
1243
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NamespaceProperty, new CodePrimitiveExpression(collectionContract.
XmlName
.Namespace)));
1307
? XsdDataContractImporter.ImportActualType(xmlDataContract.XsdType?.Annotation, xmlDataContract.
XmlName
, xmlDataContract.
XmlName
)
1308
: xmlDataContract.
XmlName
;
1315
(xmlDataContract.TopLevelElementName != null && xmlDataContract.TopLevelElementName.Value != xmlDataContract.
XmlName
.Name) ||
1316
(xmlDataContract.TopLevelElementNamespace != null && xmlDataContract.TopLevelElementNamespace.Value != xmlDataContract.
XmlName
.Namespace);
1455
if (!Namespaces.TryGetValue(dataContract.
XmlName
.Namespace, out clrNamespace))
1463
clrNamespace = GetClrNamespace(dataContract.
XmlName
.Namespace);
1477
AddNamespacePair(dataContract.
XmlName
.Namespace, clrNamespace);