System.Xml.XmlNode.RemoveChild C# (CSharp) Méthode

RemoveChild() public méthode

public RemoveChild ( XmlNode child ) : XmlNode
child XmlNode
Résultat XmlNode
        public XmlNode RemoveChild(XmlNode child)
        {
            return default(XmlNode);
        }

Usage Example

Exemple #1
0
 public bool DisableRewriter(string configPath)
 {
     try
     {
         XmlDocument xDoc = new XmlDocument();
         xDoc.Load(configPath);
         if (xDoc != null)
         {
             System.Xml.XmlNode xRoot = xDoc.DocumentElement;
             System.Xml.XmlNode xNode = xRoot.SelectSingleNode("//system.webServer/modules");
             if (xNode != null)
             {
                 bool isInstalled = false;
                 foreach (XmlNode n in xNode.ChildNodes)
                 {
                     if (n.Attributes["name"].Value == "ForumsReWriter")
                     {
                         xNode.RemoveChild(n);
                         isInstalled = true;
                         break;
                     }
                 }
                 if (isInstalled)
                 {
                     xDoc.Save(configPath);
                 }
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
All Usage Examples Of System.Xml.XmlNode::RemoveChild