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

AppendChild() public méthode

public AppendChild ( XmlNode node ) : XmlNode
node XmlNode
Résultat XmlNode
        public XmlNode AppendChild(XmlNode node)
        {
            return default(XmlNode);
        }

Usage Example

Exemple #1
0
        public String SetDeviceConfig()
        {
            System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
            System.Xml.XmlNode     xnRoot = xmlDoc.CreateElement("root");

            foreach (Devices devices in deviceList)
            {
                System.Xml.XmlDocument xmlDocChild = new System.Xml.XmlDocument();
                System.Xml.XmlNode     xnRecord    = xmlDoc.CreateElement("device");

                System.Xml.XmlNode xnSuite = xmlDoc.CreateElement("suite");
                xnSuite.InnerText = devices.suite.ToString();
                xnRecord.AppendChild(xnSuite);

                System.Xml.XmlNode xnAddress = xmlDoc.CreateElement("address");
                xnAddress.InnerText = devices.address.ToString();
                xnRecord.AppendChild(xnAddress);

                System.Xml.XmlNode xnDeviceType = xmlDoc.CreateElement("deviceType");
                xnDeviceType.InnerText = devices.deviceType.ToString();
                xnRecord.AppendChild(xnDeviceType);

                System.Xml.XmlNode xnFactory = xmlDoc.CreateElement("factory");
                xnFactory.InnerText = devices.factory.ToString();
                xnRecord.AppendChild(xnFactory);
            }
            return(xnRoot.OuterXml);
        }
All Usage Examples Of System.Xml.XmlNode::AppendChild