System.Xml.XmlNode.ReplaceChild C# (CSharp) Метод

ReplaceChild() публичный Метод

public ReplaceChild ( XmlNode node, XmlNode child ) : XmlNode
node XmlNode
child XmlNode
Результат XmlNode
        public XmlNode ReplaceChild(XmlNode node, XmlNode child)
        {
            return default(XmlNode);
        }

Usage Example

        private static void ReplaceDefs(XmlNode xmlNode)
        {
            for (var i = 0; i < xmlNode.ChildNodes.Count; i++)
            {
                var childNode = xmlNode.ChildNodes[i];
                ReplaceDefs(childNode);
                if (childNode.Name != "defs")
                {
                    continue;
                }

                var gNode = childNode.OwnerDocument.CreateElement("g", childNode.NamespaceURI);
                foreach (XmlAttribute attribute in childNode.Attributes)
                {
                    gNode.SetAttributeNode((XmlAttribute)attribute.Clone());
                }
                gNode.SetAttribute("display", "none");
                while (childNode.HasChildNodes)
                {
                    gNode.AppendChild(childNode.FirstChild);
                }

                xmlNode.ReplaceChild(gNode, childNode);
            }
        }
All Usage Examples Of System.Xml.XmlNode::ReplaceChild