34 writes to Name
System.Private.Xml (34)
System\Xml\Serialization\Mappings.cs (2)
175
newAccessor.
Name
= this.Name;
259
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);
1523
arrayItemElement.
Name
= xmlArrayItem.ElementName.Length == 0 ? arrayItemElement.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlArrayItem.ElementName);
1606
attribute.
Name
= Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName);
1636
text.
Name
= accessorName; // unused except to make more helpful error messages
1671
element.
Name
= XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName);
1676
element.
Name
= xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName);
1720
element.
Name
= anyName;
1762
arrayElement.
Name
= XmlConvert.EncodeLocalName(a.XmlArray.ElementName.Length == 0 ? accessorName : a.XmlArray.ElementName);
1799
attribute.
Name
= Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName);
1825
text.
Name
= accessorName; // unused except to make more helpful error messages
1843
element.
Name
= XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName);
1913
element.
Name
= XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName);
1917
element.
Name
= xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName);
1962
element.
Name
= anyName;
2300
element.
Name
= mapping.DefaultElementName;
2329
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)
864
element.
Name
= typeDesc.DataType!.Name;
176 references to Name
System.Private.Xml (176)
System\Xml\Serialization\Compilation.cs (2)
668
throw new InvalidOperationException(SR.Format(SR.XmlNotSerializable, mapping.Accessor.
Name
));
695
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
;
251
int colon =
Name
.LastIndexOf(':');
255
if (!
Name
.StartsWith("xml:", StringComparison.Ordinal))
257
throw new InvalidOperationException(SR.Format(SR.Xml_InvalidNameChars,
Name
));
259
Name =
Name
.Substring("xml:".Length);
653
throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, TypeDesc!.FullName, text.
Name
, text.Mapping.TypeDesc.FullName));
844
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)
867
return (Attribute.
Name
== mapping.Attribute.
Name
&& Attribute.Namespace == mapping.Attribute.Namespace && Attribute.Form == mapping.Attribute.Form);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (9)
109
string elementName = element.
Name
;
114
if (Reader.IsStartElement(element.
Name
, elementNs))
210
if (mapping.Elements[j].Any && mapping.Elements[j].
Name
.Length == 0)
345
string name = element.
Name
;
819
else if ((isSequence && ele.Any && ele.AnyNamespaces == null) || (ele.
Name
== Reader.LocalName && ns == Reader.NamespaceURI))
885
if (element.Any && element.
Name
.Length == 0)
1724
if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].
Name
))
2043
memberFound = XmlNodeEqual(Reader, attribute.
Name
, XmlReservedNs.NsXml);
2047
memberFound = XmlNodeEqual(Reader, attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (24)
91
WriteNullTagEncoded(element.
Name
, ns);
95
WriteNullTagLiteral(element.
Name
, ns);
100
WriteEmptyTag(element.
Name
, ns);
289
string name = element.
Name
;
290
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
370
if (element.
Name
!= null && element.
Name
.Length > 0)
423
if (element.
Name
== elem.Name && element.Namespace == elem.NamespaceURI)
466
if (element.Any && element.
Name
.Length == 0)
482
if (element.
Name
== choiceName)
497
if (element.Any && element.
Name
.Length == 0)
503
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, element.Namespace + ":" + element.
Name
, element.
Name
, element.Namespace));
551
string name = writeAccessor ? element.
Name
: element.Mapping!.TypeName!;
552
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : string.Empty);
564
WriteNullTagLiteral(element.
Name
, ns);
572
WriteNullTagLiteral(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
634
WriteNullTagEncoded(element.
Name
, ns);
638
WriteNullTagLiteral(element.
Name
, ns);
1003
Writer.WriteStartAttribute(null, attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
1080
WriteAttribute(attribute.
Name
, ns, sb.ToString());
1118
WritePrimitive(WritePrimitiveMethodRequirement.WriteAttribute, attribute.
Name
, ns, attribute.Default, memberValue, attribute.Mapping!, false);
1442
WriteStartElement(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty), mapping.IsSoap);
1527
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 (27)
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!)));
879
throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, typeName, member.Text.
Name
, member.Text.Mapping.TypeDesc.FullName));
1726
if (element.
Name
.Length > 0)
1739
elements.Add(element.
Name
, element.Namespace, element);
1969
if (element.
Name
.Length > 0)
1987
elements.Add(element.
Name
, element.Namespace, element);
1998
throw new InvalidOperationException(SR.Format(SR.XmlRpcLitArrayElement, accessor.Elements[0].
Name
));
2017
if (element.Any && element.
Name
.Length == 0)
2032
if (element.
Name
== choiceName)
2044
if (element.Any && element.
Name
.Length == 0)
2051
string id = element.Namespace != null && element.Namespace.Length > 0 ? $"{element.Namespace}:{element.
Name
}" : element.
Name
;
2053
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, accessor.ChoiceIdentifier.Mapping!.TypeDesc!.FullName, id, element.
Name
, element.Namespace));
2207
Accessor? existing = (Accessor?)scope[accessor.
Name
, accessor.Namespace];
2212
throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementName, existing.
Name
, existing.Namespace));
2220
throw new InvalidOperationException(SR.Format(SR.XmlDuplicateAttributeName, existing.
Name
, existing.Namespace));
2225
scope[accessor.
Name
, accessor.Namespace] = accessor;
2246
Accessor? existing = (Accessor?)scope[accessor.
Name
, accessor.Namespace];
2249
scope[accessor.
Name
, accessor.Namespace] = null;
2254
throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, $"The XML attribute/element '{accessor.Namespace}{accessor.
Name
}' does not have an existing accessor to remove."));
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
;
692
attribute.RefName = new XmlQualifiedName(accessor.
Name
, XmlReservedNs.NsXml);
728
attribute.Name = accessor.
Name
;
753
refAttribute.RefName = new XmlQualifiedName(accessor.
Name
, accessor.Namespace);
799
if (accessor.Any && accessor.
Name
.Length == 0)
818
element.Name = accessor.
Name
;
846
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)
2430
expectedElement += e.
Name
;
2542
string methodName = NextMethodName(element.
Name
);
2559
WriteIsStartTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2609
if (mapping.Elements[j].Any && mapping.Elements[j].
Name
.Length == 0)
2721
string methodName = NextMethodName(element.
Name
);
2742
WriteXmlNodeEqual("Reader", element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2853
string methodName = NextMethodName(element.
Name
);
3397
if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].
Name
))
3776
WriteXmlNodeEqual("Reader", attribute.
Name
, XmlReservedNs.NsXml);
3779
WriteXmlNodeEqual("Reader", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "");
3844
qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.
Name
}";
4064
if (e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
4068
qnames += $"{ns}:{e.
Name
}";
4254
if (element.Any && element.
Name
.Length == 0)
4307
if (!isSequence && e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
4364
WriteXmlNodeEqual("Reader", e.
Name
, ns);
System\Xml\Serialization\XmlSerializationReaderILGen.cs (14)
401
expectedElement += e.
Name
;
464
string methodName = NextMethodName(element.
Name
);
498
WriteIsStartTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
548
if (mapping.Elements[j].Any && mapping.Elements[j].
Name
.Length == 0)
707
string methodName = NextMethodName(element.
Name
);
1633
if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].
Name
))
1928
WriteXmlNodeEqual("Reader", attribute.
Name
, XmlReservedNs.NsXml);
1931
WriteXmlNodeEqual("Reader", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "");
2082
qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.
Name
}";
2293
if (e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
2297
qnames += $"{ns}:{e.
Name
}";
2543
if (element.Any && element.
Name
.Length == 0)
2591
if (!isSequence && e.Any && string.IsNullOrEmpty(e.
Name
)) continue;
2638
WriteXmlNodeEqual("Reader", e.
Name
, ns, false);
System\Xml\Serialization\XmlSerializationWriter.cs (22)
2656
string methodName = NextMethodName(element.
Name
);
2677
WriteStartElement(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""), mapping.IsSoap);
2813
WriteQuotedCSharpString(member.Elements[0].
Name
);
2863
string methodName = NextMethodName(element.
Name
);
2877
WriteEncodedNullTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
2879
WriteLiteralNullTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
2882
WriteEmptyTag(element.
Name
, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""));
3354
WriteQuotedCSharpString(attribute.
Name
);
3478
WriteQuotedCSharpString(attribute.
Name
);
3526
WritePrimitive("WriteAttribute", attribute.
Name
, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", attribute.Default, source, attribute.Mapping, false, false, false);
3740
if (element.
Name
!= null && element.
Name
.Length > 0)
3845
WriteQuotedCSharpString(element.
Name
);
3977
string name = writeAccessor ? element.
Name
: element.Mapping!.TypeName!;
3978
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : "");
3998
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
4316
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
4538
if (element.Any && element.
Name
.Length == 0)
4554
if (choiceName.SequenceEqual(element.
Name
))
4568
if (element.Any && element.
Name
.Length == 0)
4574
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);
1640
if (element.
Name
!= null && element.
Name
.Length > 0)
1766
ilg.Ldstr(GetCSharpString(element.
Name
));
1941
string name = writeAccessor ? element.
Name
: element.Mapping!.TypeName!;
1942
string? ns = element.Any && element.
Name
.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : "");
1969
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2231
WriteLiteralNullTag(element.
Name
, element.Form == XmlSchemaForm.Qualified ? element.Namespace : "");
2291
if (element.Any && element.
Name
.Length == 0)
2305
if (element.
Name
== choiceName)
2317
if (element.Any && element.
Name
.Length == 0)
2323
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, $"{element.Namespace}:{element.
Name
}", element.
Name
, element.Namespace));