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); 1517arrayItemElement.Name = xmlArrayItem.ElementName.Length == 0 ? arrayItemElement.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlArrayItem.ElementName); 1600attribute.Name = Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName); 1630text.Name = accessorName; // unused except to make more helpful error messages 1651element.Name = XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName); 1656element.Name = xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName); 1700element.Name = anyName; 1742arrayElement.Name = XmlConvert.EncodeLocalName(a.XmlArray.ElementName.Length == 0 ? accessorName : a.XmlArray.ElementName); 1779attribute.Name = Accessor.EscapeQName(a.XmlAttribute.AttributeName.Length == 0 ? accessorName : a.XmlAttribute.AttributeName); 1805text.Name = accessorName; // unused except to make more helpful error messages 1823element.Name = XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName); 1893element.Name = XmlConvert.EncodeLocalName(xmlElement.ElementName.Length == 0 ? accessorName : xmlElement.ElementName); 1897element.Name = xmlElement.ElementName.Length == 0 ? element.Mapping.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName); 1942element.Name = anyName; 2250element.Name = mapping.DefaultElementName; 2279element.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)
851element.Name = typeDesc.DataType!.Name;
167 references to Name
System.Private.Xml (167)
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); 639throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, TypeDesc!.FullName, text.Name, text.Mapping.TypeDesc.FullName)); 830if (a[i].Name != b[i].Name || a[i].Namespace != b[i].Namespace || a[i].Form != b[i].Form || a[i].IsNullable != b[i].IsNullable) 853return (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) 1006member?.ChoiceSource?.Invoke(element.Name); 1619if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].Name)) 1857memberFound = XmlNodeEqual(Reader, attribute.Name, XmlReservedNs.NsXml); 1861memberFound = XmlNodeEqual(Reader, attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (17)
89WriteNullTagEncoded(element.Name, ns); 93WriteNullTagLiteral(element.Name, ns); 98WriteEmptyTag(element.Name, ns); 208if (element.Name != null && element.Name.Length > 0) 242if (element.Name == elem.Name && element.Namespace == elem.NamespaceURI) 318string name = writeAccessor ? element.Name : element.Mapping!.TypeName!; 319string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : string.Empty); 331WriteNullTagLiteral(element.Name, ns); 339WriteNullTagLiteral(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty); 401WriteNullTagEncoded(element.Name, ns); 405WriteNullTagLiteral(element.Name, ns); 774Writer.WriteStartAttribute(null, attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty); 851WriteAttribute(attribute.Name, ns, sb.ToString()); 889WritePrimitive(WritePrimitiveMethodRequirement.WriteAttribute, attribute.Name, ns, attribute.Default, memberValue, attribute.Mapping!, false); 1199WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty), mapping.IsSoap); 1284WriteRpcResult(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 (24)
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!))); 874throw new InvalidOperationException(SR.Format(SR.XmlIllegalTypedTextAttribute, typeName, member.Text.Name, member.Text.Mapping.TypeDesc.FullName)); 1706if (element.Name.Length > 0) 1719elements.Add(element.Name, element.Namespace, element); 1949if (element.Name.Length > 0) 1967elements.Add(element.Name, element.Namespace, element); 1978throw new InvalidOperationException(SR.Format(SR.XmlRpcLitArrayElement, accessor.Elements[0].Name)); 1997if (element.Any && element.Name.Length == 0) 2012if (element.Name == choiceName) 2024if (element.Any && element.Name.Length == 0) 2031string id = element.Namespace != null && element.Namespace.Length > 0 ? $"{element.Namespace}:{element.Name}" : element.Name; 2033throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, accessor.ChoiceIdentifier.Mapping!.TypeDesc!.FullName, id, element.Name, element.Namespace)); 2187Accessor? existing = (Accessor?)scope[accessor.Name, accessor.Namespace]; 2192throw new InvalidOperationException(SR.Format(SR.XmlDuplicateElementName, existing.Name, existing.Namespace)); 2200throw new InvalidOperationException(SR.Format(SR.XmlDuplicateAttributeName, existing.Name, existing.Namespace)); 2205scope[accessor.Name, accessor.Namespace] = accessor;
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; 696attribute.RefName = new XmlQualifiedName(accessor.Name, XmlReservedNs.NsXml); 732attribute.Name = accessor.Name; 757refAttribute.RefName = new XmlQualifiedName(accessor.Name, accessor.Namespace); 803if (accessor.Any && accessor.Name.Length == 0) 822element.Name = accessor.Name; 850refElement.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)
2366expectedElement += e.Name; 2478string methodName = NextMethodName(element.Name); 2495WriteIsStartTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 2545if (mapping.Elements[j].Any && mapping.Elements[j].Name.Length == 0) 2657string methodName = NextMethodName(element.Name); 2678WriteXmlNodeEqual("Reader", element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 2789string methodName = NextMethodName(element.Name); 3333if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].Name)) 3712WriteXmlNodeEqual("Reader", attribute.Name, XmlReservedNs.NsXml); 3715WriteXmlNodeEqual("Reader", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : ""); 3780qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.Name}"; 3993if (e.Any && string.IsNullOrEmpty(e.Name)) continue; 3997qnames += $"{ns}:{e.Name}"; 4159if (element.Any && element.Name.Length == 0) 4212if (!isSequence && e.Any && string.IsNullOrEmpty(e.Name)) continue; 4269WriteXmlNodeEqual("Reader", e.Name, ns);
System\Xml\Serialization\XmlSerializationReaderILGen.cs (14)
325expectedElement += e.Name; 388string methodName = NextMethodName(element.Name); 422WriteIsStartTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 472if (mapping.Elements[j].Any && mapping.Elements[j].Name.Length == 0) 631string methodName = NextMethodName(element.Name); 1557if (mapping.Elements[j].Any && string.IsNullOrEmpty(mapping.Elements[j].Name)) 1852WriteXmlNodeEqual("Reader", attribute.Name, XmlReservedNs.NsXml); 1855WriteXmlNodeEqual("Reader", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : ""); 2006qnames += attribute.IsSpecialXmlNamespace ? XmlReservedNs.NsXml : $"{(attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "")}:{attribute.Name}"; 2216if (e.Any && string.IsNullOrEmpty(e.Name)) continue; 2220qnames += $"{ns}:{e.Name}"; 2427if (element.Any && element.Name.Length == 0) 2475if (!isSequence && e.Any && string.IsNullOrEmpty(e.Name)) continue; 2522WriteXmlNodeEqual("Reader", e.Name, ns, false);
System\Xml\Serialization\XmlSerializationWriter.cs (22)
2609string methodName = NextMethodName(element.Name); 2630WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""), mapping.IsSoap); 2766WriteQuotedCSharpString(member.Elements[0].Name); 2816string methodName = NextMethodName(element.Name); 2830WriteEncodedNullTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 2832WriteLiteralNullTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 2835WriteEmptyTag(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : "")); 3307WriteQuotedCSharpString(attribute.Name); 3431WriteQuotedCSharpString(attribute.Name); 3479WritePrimitive("WriteAttribute", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", attribute.Default, source, attribute.Mapping, false, false, false); 3675if (element.Name != null && element.Name.Length > 0) 3780WriteQuotedCSharpString(element.Name); 3912string name = writeAccessor ? element.Name : element.Mapping!.TypeName!; 3913string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : ""); 3933WriteLiteralNullTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 4251WriteLiteralNullTag(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : ""); 4453if (element.Any && element.Name.Length == 0) 4469if (choiceName.SequenceEqual(element.Name)) 4483if (element.Any && element.Name.Length == 0) 4489throw 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));