34 writes to Name
System.Private.Xml (34)
System\Xml\Serialization\Mappings.cs (2)
175newAccessor.Name = this.Name; 244Name = Name.Substring("xml:".Length);
System\Xml\Serialization\SoapReflectionImporter.cs (5)
88element.Name = element.Mapping.DefaultElementName; 125element.Name = string.IsNullOrEmpty(elementName) ? elementName : XmlConvert.EncodeLocalName(elementName); 703attribute.Name = Accessor.EscapeQName(a.SoapAttribute == null || a.SoapAttribute.AttributeName.Length == 0 ? accessorName : a.SoapAttribute.AttributeName); 718element.Name = XmlConvert.EncodeLocalName(a.SoapElement == null || a.SoapElement.ElementName.Length == 0 ? accessorName : a.SoapElement.ElementName); 732element.Name = mapping.TypeName;
System\Xml\Serialization\XmlReflectionImporter.cs (17)
222element.Name = string.IsNullOrEmpty(elementName) ? elementName : XmlConvert.EncodeLocalName(elementName); 283element.Name = XmlConvert.EncodeLocalName(root.ElementName); 1522arrayItemElement.Name = xmlArrayItem.ElementName.Length == 0 ? arrayItemElement.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlArrayItem.ElementName); 1605attribute.Name = Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName); 1635text.Name = accessorName; // unused except to make more helpful error messages 1656element.Name = XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName); 1661element.Name = xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName); 1705element.Name = anyName; 1747arrayElement.Name = XmlConvert.EncodeLocalName(a.XmlArray.ElementName.Length == 0 ? accessorName : a.XmlArray.ElementName); 1784attribute.Name = Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName); 1810text.Name = accessorName; // unused except to make more helpful error messages 1828element.Name = XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName); 1898element.Name = XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName); 1902element.Name = xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName); 1947element.Name = anyName; 2285element.Name = mapping.DefaultElementName; 2314element.Name = XmlConvert.EncodeLocalName(typeName);
System\Xml\Serialization\XmlSchemaImporter.cs (9)
100accessor.Name = typeName.Name; 167accessor.Name = elementName; 239accessor.Name = Accessor.EscapeName(name); 295accessor.Name = element.Name; 867choiceAccessor.Name = choiceIdentifier.Name; 874choiceAccessor.Name = choiceIdentifier.Name = member.ChoiceIdentifier.MemberName = membersScope.AddUnique(member.ChoiceIdentifier.MemberName, choiceIdentifier); 1249arrayAccessor.Name = element.Name; 1594accessor.Name = name.Name; 1629accessor.Name = attribute.Name;
System\Xml\Serialization\XmlSerializer.cs (1)
850element.Name = typeDesc.DataType!.Name;
175 references to Name
System.Private.Xml (175)
System\Xml\Serialization\Compilation.cs (2)
621throw new InvalidOperationException(SR.Format(SR.XmlNotSerializable, mapping.Accessor.Name)); 648throw new InvalidOperationException(SR.Format(SR.XmlNotSerializable, mapping.Accessor.Name));
System\Xml\Serialization\Mappings.cs (13)
135return $"{Namespace ?? "##any"}:{Name}"; 139return Namespace == defaultNs ? Name : $"{Namespace}:{Name}"; 175newAccessor.Name = this.Name; 236int colon = Name.LastIndexOf(':'); 240if (!Name.StartsWith("xml:", StringComparison.Ordinal)) 242throw new InvalidOperationException(SR.Format(SR.Xml_InvalidNameChars, Name)); 244Name = Name.Substring("xml:".Length); 638throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, TypeDesc!.FullName, text.Name, text.Mapping.TypeDesc.FullName)); 829if (a[i].Name != b[i].Name || a[i].Namespace != b[i].Namespace || a[i].Form != b[i].Form || a[i].IsNullable != b[i].IsNullable) 852return (Attribute.Name == mapping.Attribute.Name && Attribute.Namespace == mapping.Attribute.Namespace && Attribute.Form == mapping.Attribute.Form);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (10)
102string elementName = element.Name; 107if (Reader.IsStartElement(element.Name, elementNs)) 203if (mapping.Elements[j].Any && mapping.Elements[j].Name.Length == 0) 337string name = element.Name; 782else if (ele.Name == Reader.LocalName && ns == Reader.NamespaceURI) 828if (element.Any && element.Name.Length == 0) 1016member?.ChoiceSource?.Invoke(element.Name); 1629if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].Name)) 1919memberFound = XmlNodeEqual(Reader, attribute.Name, XmlReservedNs.NsXml); 1923memberFound = XmlNodeEqual(Reader, attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (22)
90WriteNullTagEncoded(element.Name, ns); 94WriteNullTagLiteral(element.Name, ns); 99WriteEmptyTag(element.Name, ns); 212if (element.Name != null && element.Name.Length > 0) 265if (element.Name == elem.Name && element.Namespace == elem.NamespaceURI) 308if (element.Any && element.Name.Length == 0) 324if (element.Name == choiceName) 339if (element.Any && element.Name.Length == 0) 345throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, element.Namespace + ":" + element.Name, element.Name, element.Namespace)); 393string name = writeAccessor ? element.Name : element.Mapping!.TypeName!; 394string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : string.Empty); 406WriteNullTagLiteral(element.Name, ns); 414WriteNullTagLiteral(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty); 476WriteNullTagEncoded(element.Name, ns); 480WriteNullTagLiteral(element.Name, ns); 849Writer.WriteStartAttribute(null, attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty); 926WriteAttribute(attribute.Name, ns, sb.ToString()); 964WritePrimitive(WritePrimitiveMethodRequirement.WriteAttribute, attribute.Name, ns, attribute.Default, memberValue, attribute.Mapping!, false); 1284WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty), mapping.IsSoap); 1369WriteRpcResult(member.Elements[0].Name, string.Empty);
System\Xml\Serialization\XmlMapping.cs (2)
61get { return System.Xml.Serialization.Accessor.UnescapeName(Accessor.Name); } 69get { return Accessor.Name; }
System\Xml\Serialization\XmlMemberMapping.cs (2)
39get { return Accessor.UnescapeName(Accessor!.Name); } 47get { return Accessor!.Name; }
System\Xml\Serialization\XmlReflectionImporter.cs (27)
314if (accessor.Any && accessor.Name.Length == 0) 317Accessor? existing = (Accessor?)accessors[accessor.Name, accessor.Namespace]; 321accessors.Add(accessor.Name, accessor.Namespace, accessor); 341throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAccessorDefault, accessor.Name, accessor.Namespace, value1, value2)); 346throw new InvalidOperationException(SR.Format(SR.XmlMethodTypeNameConflict, accessor.Name, accessor.Namespace)); 352throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAccessor, accessor.Name, accessor.Namespace, GetMappingName(existing.Mapping!), GetMappingName(accessor.Mapping))); 369throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAttributeAccessor, accessor.Name, accessor.Namespace, GetMappingName(existing.Mapping!), GetMappingName(accessor.Mapping!))); 371throw new InvalidOperationException(SR.Format(SR.XmlCannotReconcileAccessor, accessor.Name, accessor.Namespace, GetMappingName(existing.Mapping!), GetMappingName(accessor.Mapping!))); 878throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, typeName, member.Text.Name, member.Text.Mapping.TypeDesc.FullName)); 1711if (element.Name.Length > 0) 1724elements.Add(element.Name, element.Namespace, element); 1954if (element.Name.Length > 0) 1972elements.Add(element.Name, element.Namespace, element); 1983throw new InvalidOperationException(SR.Format(SR.XmlRpcLitArrayElement, accessor.Elements[0].Name)); 2002if (element.Any && element.Name.Length == 0) 2017if (element.Name == choiceName) 2029if (element.Any && element.Name.Length == 0) 2036string id = element.Namespace != null && element.Namespace.Length > 0 ? $"{element.Namespace}:{element.Name}" : element.Name; 2038throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, accessor.ChoiceIdentifier.Mapping!.TypeDesc!.FullName, id, element.Name, element.Namespace)); 2192Accessor? existing = (Accessor?)scope[accessor.Name, accessor.Namespace]; 2197throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementName, existing.Name, existing.Namespace)); 2205throw new InvalidOperationException(SR.Format(SR.XmlDuplicateAttributeName, existing.Name, existing.Namespace)); 2210scope[accessor.Name, accessor.Namespace] = accessor; 2231Accessor? existing = (Accessor?)scope[accessor.Name, accessor.Namespace]; 2234scope[accessor.Name, accessor.Namespace] = null; 2239throw 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)
51type.Name = xmlMembersMapping.Accessor.Name; 55return (new XmlQualifiedName(xmlMembersMapping.Accessor.Name, xmlMembersMapping.Accessor.Namespace)); 79throw new InvalidOperationException(SR.Format(SR.XmlBareAttributeMember, member.Attribute.Name)); 81throw new InvalidOperationException(SR.Format(SR.XmlBareTextMember, member.Text.Name)); 86throw new InvalidOperationException(SR.Format(SR.XmlIllegalArrayElement, member.Elements[0].Name)); 235if (accessor.Any && accessor.Name.Length == 0) 240element.Name = accessor.Name; 692attribute.RefName = new XmlQualifiedName(accessor.Name, XmlReservedNs.NsXml); 728attribute.Name = accessor.Name; 753refAttribute.RefName = new XmlQualifiedName(accessor.Name, accessor.Namespace); 799if (accessor.Any && accessor.Name.Length == 0) 818element.Name = accessor.Name; 846refElement.RefName = new XmlQualifiedName(accessor.Name, accessor.Namespace);
System\Xml\Serialization\XmlSchemaImporter.cs (10)
207member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name)); 875members?.Add(choiceAccessor.Name, choiceIdentifier); 889if (item.Name != itemMapping.DefaultElementName) 988ElementAccessor? scopeElement = (ElementAccessor?)scope[element.Name, element.Namespace]; 993throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementInScope, element.Name, element.Namespace)); 997throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementInScope1, element.Name, element.Namespace)); 1003scope[element.Name, element.Namespace] = element; 1420string name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name)); 1470member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name)); 1816string constantName = CodeIdentifier.MakeValid(element.Name);
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
267WriteQuotedCSharpString(mapping.Accessor.Name);
System\Xml\Serialization\XmlSerializationILGen.cs (1)
348ilg.Ldstr(GetCSharpString(mapping.Accessor.Name));
System\Xml\Serialization\XmlSerializationReader.cs (16)
2392expectedElement += e.Name; 2504string methodName = NextMethodName(element.Name); 2521WriteIsStartTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 2571if (mapping.Elements[j].Any && mapping.Elements[j].Name.Length == 0) 2683string methodName = NextMethodName(element.Name); 2704WriteXmlNodeEqual("Reader", element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 2815string methodName = NextMethodName(element.Name); 3359if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].Name)) 3738WriteXmlNodeEqual("Reader", attribute.Name, XmlReservedNs.NsXml); 3741WriteXmlNodeEqual("Reader", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : ""); 3806qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.Name}"; 4019if (e.Any && string.IsNullOrEmpty(e.Name)) continue; 4023qnames += $"{ns}:{e.Name}"; 4185if (element.Any && element.Name.Length == 0) 4238if (!isSequence && e.Any && string.IsNullOrEmpty(e.Name)) continue; 4295WriteXmlNodeEqual("Reader", e.Name, ns);
System\Xml\Serialization\XmlSerializationReaderILGen.cs (14)
324expectedElement += e.Name; 387string methodName = NextMethodName(element.Name); 421WriteIsStartTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 471if (mapping.Elements[j].Any && mapping.Elements[j].Name.Length == 0) 630string methodName = NextMethodName(element.Name); 1556if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].Name)) 1851WriteXmlNodeEqual("Reader", attribute.Name, XmlReservedNs.NsXml); 1854WriteXmlNodeEqual("Reader", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : ""); 2005qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.Name}"; 2215if (e.Any && string.IsNullOrEmpty(e.Name)) continue; 2219qnames += $"{ns}:{e.Name}"; 2426if (element.Any && element.Name.Length == 0) 2474if (!isSequence && e.Any && string.IsNullOrEmpty(e.Name)) continue; 2521WriteXmlNodeEqual("Reader", e.Name, ns, false);
System\Xml\Serialization\XmlSerializationWriter.cs (22)
2656string methodName = NextMethodName(element.Name); 2677WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""), mapping.IsSoap); 2813WriteQuotedCSharpString(member.Elements[0].Name); 2863string methodName = NextMethodName(element.Name); 2877WriteEncodedNullTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 2879WriteLiteralNullTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 2882WriteEmptyTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 3354WriteQuotedCSharpString(attribute.Name); 3478WriteQuotedCSharpString(attribute.Name); 3526WritePrimitive("WriteAttribute", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", attribute.Default, source, attribute.Mapping, false, false, false); 3722if (element.Name != null && element.Name.Length > 0) 3827WriteQuotedCSharpString(element.Name); 3959string name = writeAccessor ? element.Name : element.Mapping!.TypeName!; 3960string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : ""); 3980WriteLiteralNullTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 4298WriteLiteralNullTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 4520if (element.Any && element.Name.Length == 0) 4536if (choiceName.SequenceEqual(element.Name)) 4550if (element.Any && element.Name.Length == 0) 4556throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, $"{element.Namespace}:{element.Name}", element.Name, element.Namespace));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (20)
355string methodName = NextMethodName(element.Name); 391WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""), false); 546string methodName = NextMethodName(element.Name); 567WriteLiteralNullTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 570WriteEmptyTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 1187ilg.Ldstr(GetCSharpString(attribute.Name)); 1317ilg.Ldstr(GetCSharpString(attribute.Name)); 1381WritePrimitive("WriteAttribute", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", GetConvertedDefaultValue(source.Type, attribute.Default), source, attribute.Mapping, false, false, false); 1597if (element.Name != null && element.Name.Length > 0) 1723ilg.Ldstr(GetCSharpString(element.Name)); 1898string name = writeAccessor ? element.Name : element.Mapping!.TypeName!; 1899string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : ""); 1926WriteLiteralNullTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 2188WriteLiteralNullTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 2248if (element.Any && element.Name.Length == 0) 2262if (element.Name == choiceName) 2274if (element.Any && element.Name.Length == 0) 2280throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, $"{element.Namespace}:{element.Name}", element.Name, element.Namespace));