System.Xml.XmlAttributeCollection.Append C# (CSharp) Méthode

Append() public méthode

public Append ( XmlAttribute node ) : XmlAttribute
node XmlAttribute
Résultat XmlAttribute
        public XmlAttribute Append(XmlAttribute node) {
            XmlDocument doc = node.OwnerDocument;
            if (doc == null || doc.IsLoading == false) {
                if (doc != null && doc != parent.OwnerDocument) {
                    throw new ArgumentException(Res.GetString(Res.Xdom_NamedNode_Context));
                }
                if (node.OwnerElement != null) {
                    Detach(node);
                }
                AddNode(node);
            }
            else {
                base.AddNodeForLoad(node, doc);
                InsertParentIntoElementIdAttrMap(node);
            }
            return node; 
        }

Usage Example

Exemple #1
0
        static void SortXmlAttributeCollection( XmlAttributeCollection col )
        {
            // Remove, sort, then re-add the attributes to the collection.
            if (sort_attr && col != null && col.Count > 0) {
                List<XmlAttribute> attrs = new List<XmlAttribute>(col.Count);

                for (int i = col.Count - 1; i >= 0; i--) {
                    attrs.Add(col[i]);
                    col.RemoveAt(i);
                }

                SortAttributeList(attrs);

                for (int i = 0; i < attrs.Count; i++) {
                    col.Append(attrs[i]);
                }
            }
        }
All Usage Examples Of System.Xml.XmlAttributeCollection::Append