XmlTransformer.XmlAttributePreservationDict.WritePreservedAttributes C# (CSharp) Méthode

WritePreservedAttributes() private méthode

private WritePreservedAttributes ( XmlAttributePreservingWriter writer, XmlAttributeCollection attributes ) : void
writer XmlAttributePreservingWriter
attributes System.Xml.XmlAttributeCollection
Résultat void
        internal void WritePreservedAttributes(XmlAttributePreservingWriter writer, XmlAttributeCollection attributes)
        {
            string newLineString = (string)null;
            if (this.attributeNewLineString != null)
                newLineString = writer.SetAttributeNewLineString(this.attributeNewLineString);
            try
            {
                foreach (string key in this.orderedAttributes)
                {
                    XmlAttribute xmlAttribute = attributes[key];
                    if (xmlAttribute != null)
                    {
                        if (this.leadingSpaces.ContainsKey(key))
                            writer.WriteAttributeWhitespace(this.leadingSpaces[key]);
                        xmlAttribute.WriteTo((XmlWriter)writer);
                    }
                }
                if (!this.leadingSpaces.ContainsKey(string.Empty))
                    return;
                writer.WriteAttributeTrailingWhitespace(this.leadingSpaces[string.Empty]);
            }
            finally
            {
                if (newLineString != null)
                    writer.SetAttributeNewLineString(newLineString);
            }
        }