34 writes to Name
System.Private.Xml (34)
System\Xml\Serialization\Mappings.cs (2)
175
newAccessor.
Name
= this.Name;
244
Name
= Name.Substring("xml:".Length);
System\Xml\Serialization\SoapReflectionImporter.cs (5)
88
element.
Name
= element.Mapping.DefaultElementName;
125
element.
Name
= string.IsNullOrEmpty(elementName) ? elementName : XmlConvert.EncodeLocalName(elementName);
703
attribute.
Name
= Accessor.EscapeQName(a.SoapAttribute == null || a.SoapAttribute.AttributeName.Length == 0 ? accessorName : a.SoapAttribute.AttributeName);
718
element.
Name
= XmlConvert.EncodeLocalName(a.SoapElement == null || a.SoapElement.ElementName.Length == 0 ? accessorName : a.SoapElement.ElementName);
732
element.
Name
= mapping.TypeName;
System\Xml\Serialization\XmlReflectionImporter.cs (17)
222
element.
Name
= string.IsNullOrEmpty(elementName) ? elementName : XmlConvert.EncodeLocalName(elementName);
283
element.
Name
= XmlConvert.EncodeLocalName(root.ElementName);
1517
arrayItemElement.
Name
= xmlArrayItem.ElementName.Length == 0 ? arrayItemElement.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlArrayItem.ElementName);
1600
attribute.
Name
= Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName);
1630
text.
Name
= accessorName; // unused except to make more helpful error messages
1651
element.
Name
= XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName);
1656
element.
Name
= xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName);
1700
element.
Name
= anyName;
1742
arrayElement.
Name
= XmlConvert.EncodeLocalName(a.XmlArray.ElementName.Length == 0 ? accessorName : a.XmlArray.ElementName);
1779
attribute.
Name
= Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName);
1805
text.
Name
= accessorName; // unused except to make more helpful error messages
1823
element.
Name
= XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName);
1893
element.
Name
= XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName);
1897
element.
Name
= xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName);
1942
element.
Name
= anyName;
2250
element.
Name
= mapping.DefaultElementName;
2279
element.
Name
= XmlConvert.EncodeLocalName(typeName);
System\Xml\Serialization\XmlSchemaImporter.cs (9)
100
accessor.
Name
= typeName.Name;
167
accessor.
Name
= elementName;
239
accessor.
Name
= Accessor.EscapeName(name);
295
accessor.
Name
= element.Name;
867
choiceAccessor.
Name
= choiceIdentifier.Name;
874
choiceAccessor.
Name
= choiceIdentifier.Name = member.ChoiceIdentifier.MemberName = membersScope.AddUnique(member.ChoiceIdentifier.MemberName, choiceIdentifier);
1249
arrayAccessor.
Name
= element.Name;
1594
accessor.
Name
= name.Name;
1629
accessor.
Name
= attribute.Name;
System\Xml\Serialization\XmlSerializer.cs (1)
851
element.
Name
= typeDesc.DataType!.Name;
167 references to Name
System.Private.Xml (167)
System\Xml\Serialization\Compilation.cs (2)
621
throw new InvalidOperationException(SR.Format(SR.XmlNotSerializable, mapping.Accessor.
Name
));
648
throw new InvalidOperationException(SR.Format(SR.XmlNotSerializable, mapping.Accessor.
Name
));
System\Xml\Serialization\Mappings.cs (13)
135
return $"{Namespace ?? "##any"}:{
Name
}";
139
return Namespace == defaultNs ?
Name
: $"{Namespace}:{
Name
}";
175
newAccessor.Name = this.
Name
;
236
int colon =
Name
.LastIndexOf(':');
240
if (!
Name
.StartsWith("xml:", StringComparison.Ordinal))
242
throw new InvalidOperationException(SR.Format(SR.Xml_InvalidNameChars,
Name
));
244
Name =
Name
.Substring("xml:".Length);
639
throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, TypeDesc!.FullName, text.
Name
, text.Mapping.TypeDesc.FullName));
830
if (a[i].
Name
!= b[i].
Name
|| a[i].Namespace != b[i].Namespace || a[i].Form != b[i].Form || a[i].IsNullable != b[i].IsNullable)
853
return (Attribute.
Name
== mapping.Attribute.
Name
&& Attribute.Namespace == mapping.Attribute.Namespace && Attribute.Form == mapping.Attribute.Form);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (10)
102
string elementName = element.
Name
;
107
if (Reader.IsStartElement(element.
Name
, elementNs))
203
if (mapping.Elements[j].Any && mapping.Elements[j].
Name
.Length == 0)
337
string name = element.
Name
;
782
else if (ele.
Name
== Reader.LocalName && ns == Reader.NamespaceURI)
828
if (element.Any && element.
Name
.Length == 0)
1006
member?.ChoiceSource?.Invoke(element.
Name
);
1619
if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].
Name
))
1857
memberFound = XmlNodeEqual(Reader, attribute.
Name
, XmlReservedNs.NsXml);
1861
memberFound = XmlNodeEqual(Reader, attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (17)
89
WriteNullTagEncoded(element.
Name
, ns);
93
WriteNullTagLiteral(element.
Name
, ns);
98
WriteEmptyTag(element.
Name
, ns);
208
if (element.
Name
!= null && element.
Name
.Length > 0)
242
if (element.
Name
== elem.Name && element.Namespace == elem.NamespaceURI)
318
string name = writeAccessor ? element.
Name
: element.Mapping!.TypeName!;
319
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : string.Empty);
331
WriteNullTagLiteral(element.
Name
, ns);
339
WriteNullTagLiteral(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
401
WriteNullTagEncoded(element.
Name
, ns);
405
WriteNullTagLiteral(element.
Name
, ns);
774
Writer.WriteStartAttribute(null, attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
851
WriteAttribute(attribute.
Name
, ns, sb.ToString());
889
WritePrimitive(WritePrimitiveMethodRequirement.WriteAttribute, attribute.
Name
, ns, attribute.Default, memberValue, attribute.Mapping!, false);
1199
WriteStartElement(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty), mapping.IsSoap);
1284
WriteRpcResult(member.Elements[0].
Name
, string.Empty);
System\Xml\Serialization\XmlMapping.cs (2)
61
get { return System.Xml.Serialization.Accessor.UnescapeName(Accessor.
Name
); }
69
get { return Accessor.
Name
; }
System\Xml\Serialization\XmlMemberMapping.cs (2)
39
get { return Accessor.UnescapeName(Accessor!.
Name
); }
47
get { return Accessor!.
Name
; }
System\Xml\Serialization\XmlReflectionImporter.cs (24)
314
if (accessor.Any && accessor.
Name
.Length == 0)
317
Accessor? existing = (Accessor?)accessors[accessor.
Name
, accessor.Namespace];
321
accessors.Add(accessor.
Name
, accessor.Namespace, accessor);
341
throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAccessorDefault, accessor.
Name
, accessor.Namespace, value1, value2));
346
throw new InvalidOperationException(SR.Format(SR.XmlMethodTypeNameConflict, accessor.
Name
, accessor.Namespace));
352
throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAccessor, accessor.
Name
, accessor.Namespace, GetMappingName(existing.Mapping!), GetMappingName(accessor.Mapping)));
369
throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAttributeAccessor, accessor.
Name
, accessor.Namespace, GetMappingName(existing.Mapping!), GetMappingName(accessor.Mapping!)));
371
throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAccessor, accessor.
Name
, accessor.Namespace, GetMappingName(existing.Mapping!), GetMappingName(accessor.Mapping!)));
874
throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, typeName, member.Text.
Name
, member.Text.Mapping.TypeDesc.FullName));
1706
if (element.
Name
.Length > 0)
1719
elements.Add(element.
Name
, element.Namespace, element);
1949
if (element.
Name
.Length > 0)
1967
elements.Add(element.
Name
, element.Namespace, element);
1978
throw new InvalidOperationException(SR.Format(SR.XmlRpcLitArrayElement, accessor.Elements[0].
Name
));
1997
if (element.Any && element.
Name
.Length == 0)
2012
if (element.
Name
== choiceName)
2024
if (element.Any && element.
Name
.Length == 0)
2031
string id = element.Namespace != null && element.Namespace.Length > 0 ? $"{element.Namespace}:{element.
Name
}" : element.
Name
;
2033
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, accessor.ChoiceIdentifier.Mapping!.TypeDesc!.FullName, id, element.
Name
, element.Namespace));
2187
Accessor? existing = (Accessor?)scope[accessor.
Name
, accessor.Namespace];
2192
throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementName, existing.
Name
, existing.Namespace));
2200
throw new InvalidOperationException(SR.Format(SR.XmlDuplicateAttributeName, existing.
Name
, existing.Namespace));
2205
scope[accessor.
Name
, accessor.Namespace] = accessor;
System\Xml\Serialization\XmlSchemaExporter.cs (13)
51
type.Name = xmlMembersMapping.Accessor.
Name
;
55
return (new XmlQualifiedName(xmlMembersMapping.Accessor.
Name
, xmlMembersMapping.Accessor.Namespace));
79
throw new InvalidOperationException(SR.Format(SR.XmlBareAttributeMember, member.Attribute.
Name
));
81
throw new InvalidOperationException(SR.Format(SR.XmlBareTextMember, member.Text.
Name
));
86
throw new InvalidOperationException(SR.Format(SR.XmlIllegalArrayElement, member.Elements[0].
Name
));
235
if (accessor.Any && accessor.
Name
.Length == 0)
240
element.Name = accessor.
Name
;
696
attribute.RefName = new XmlQualifiedName(accessor.
Name
, XmlReservedNs.NsXml);
732
attribute.Name = accessor.
Name
;
757
refAttribute.RefName = new XmlQualifiedName(accessor.
Name
, accessor.Namespace);
803
if (accessor.Any && accessor.
Name
.Length == 0)
822
element.Name = accessor.
Name
;
850
refElement.RefName = new XmlQualifiedName(accessor.
Name
, accessor.Namespace);
System\Xml\Serialization\XmlSchemaImporter.cs (10)
207
member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.
Name
));
875
members?.Add(choiceAccessor.
Name
, choiceIdentifier);
889
if (item.
Name
!= itemMapping.DefaultElementName)
988
ElementAccessor? scopeElement = (ElementAccessor?)scope[element.
Name
, element.Namespace];
993
throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementInScope, element.
Name
, element.Namespace));
997
throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementInScope1, element.
Name
, element.Namespace));
1003
scope[element.
Name
, element.Namespace] = element;
1420
string name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.
Name
));
1470
member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.
Name
));
1816
string constantName = CodeIdentifier.MakeValid(element.
Name
);
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
267
WriteQuotedCSharpString(mapping.Accessor.
Name
);
System\Xml\Serialization\XmlSerializationILGen.cs (1)
348
ilg.Ldstr(GetCSharpString(mapping.Accessor.
Name
));
System\Xml\Serialization\XmlSerializationReader.cs (16)
2366
expectedElement += e.
Name
;
2478
string methodName = NextMethodName(element.
Name
);
2495
WriteIsStartTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2545
if (mapping.Elements[j].Any && mapping.Elements[j].
Name
.Length == 0)
2657
string methodName = NextMethodName(element.
Name
);
2678
WriteXmlNodeEqual("Reader", element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2789
string methodName = NextMethodName(element.
Name
);
3333
if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].
Name
))
3712
WriteXmlNodeEqual("Reader", attribute.
Name
, XmlReservedNs.NsXml);
3715
WriteXmlNodeEqual("Reader", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "");
3780
qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.
Name
}";
3993
if (e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
3997
qnames += $"{ns}:{e.
Name
}";
4159
if (element.Any && element.
Name
.Length == 0)
4212
if (!isSequence && e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
4269
WriteXmlNodeEqual("Reader", e.
Name
, ns);
System\Xml\Serialization\XmlSerializationReaderILGen.cs (14)
325
expectedElement += e.
Name
;
388
string methodName = NextMethodName(element.
Name
);
422
WriteIsStartTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
472
if (mapping.Elements[j].Any && mapping.Elements[j].
Name
.Length == 0)
631
string methodName = NextMethodName(element.
Name
);
1557
if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].
Name
))
1852
WriteXmlNodeEqual("Reader", attribute.
Name
, XmlReservedNs.NsXml);
1855
WriteXmlNodeEqual("Reader", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "");
2006
qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.
Name
}";
2216
if (e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
2220
qnames += $"{ns}:{e.
Name
}";
2427
if (element.Any && element.
Name
.Length == 0)
2475
if (!isSequence && e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
2522
WriteXmlNodeEqual("Reader", e.
Name
, ns, false);
System\Xml\Serialization\XmlSerializationWriter.cs (22)
2609
string methodName = NextMethodName(element.
Name
);
2630
WriteStartElement(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""), mapping.IsSoap);
2766
WriteQuotedCSharpString(member.Elements[0].
Name
);
2816
string methodName = NextMethodName(element.
Name
);
2830
WriteEncodedNullTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
2832
WriteLiteralNullTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
2835
WriteEmptyTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
3307
WriteQuotedCSharpString(attribute.
Name
);
3431
WriteQuotedCSharpString(attribute.
Name
);
3479
WritePrimitive("WriteAttribute", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", attribute.Default, source, attribute.Mapping, false, false, false);
3675
if (element.
Name
!= null && element.
Name
.Length > 0)
3780
WriteQuotedCSharpString(element.
Name
);
3912
string name = writeAccessor ? element.
Name
: element.Mapping!.TypeName!;
3913
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : "");
3933
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
4251
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
4453
if (element.Any && element.
Name
.Length == 0)
4469
if (choiceName.SequenceEqual(element.
Name
))
4483
if (element.Any && element.
Name
.Length == 0)
4489
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, $"{element.Namespace}:{element.
Name
}", element.
Name
, element.Namespace));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (20)
355
string methodName = NextMethodName(element.
Name
);
391
WriteStartElement(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""), false);
546
string methodName = NextMethodName(element.
Name
);
567
WriteLiteralNullTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
570
WriteEmptyTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
1187
ilg.Ldstr(GetCSharpString(attribute.
Name
));
1317
ilg.Ldstr(GetCSharpString(attribute.
Name
));
1381
WritePrimitive("WriteAttribute", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", GetConvertedDefaultValue(source.Type, attribute.Default), source, attribute.Mapping, false, false, false);
1597
if (element.
Name
!= null && element.
Name
.Length > 0)
1723
ilg.Ldstr(GetCSharpString(element.
Name
));
1898
string name = writeAccessor ? element.
Name
: element.Mapping!.TypeName!;
1899
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : "");
1926
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2188
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2248
if (element.Any && element.
Name
.Length == 0)
2262
if (element.
Name
== choiceName)
2274
if (element.Any && element.
Name
.Length == 0)
2280
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, $"{element.Namespace}:{element.
Name
}", element.
Name
, element.Namespace));