コード例 #1
0
ファイル: SlaveMapping.cs プロジェクト: Namrata2392/OPP
        private void exportXMLnodeSMS(XmlDocument xmlDoc, XmlNode rootNode)
        {
            string strRoutineName = "exportXMLnodeSMS";

            try
            {
                foreach (SMSSlave slv104 in Utils.getOpenProPlusHandle().getSlaveConfiguration().getSMSSlaveGroup().getSMSSlaves())
                {//Loop thru slaves...
                    XmlNode slaveNode = xmlDoc.CreateElement("SMSSlave");
                    rootNode.AppendChild(slaveNode);
                    XmlAttribute attrSlaveNode = xmlDoc.CreateAttribute("SlaveNum");
                    attrSlaveNode.Value = slv104.SlaveNum;
                    slaveNode.Attributes.Append(attrSlaveNode);

                    if (aicNode != null)
                    {
                        try
                        {
                            XmlNode importSMAINode = slaveNode.OwnerDocument.ImportNode(aicNode.exportMapXMLnode("SMSSlave_" + slv104.SlaveNum), true);
                            slaveNode.AppendChild(importSMAINode);
                        }
                        catch (System.InvalidOperationException)
                        {
                        }
                    }
                    if (aocNode != null)
                    {
                        try
                        {
                            XmlNode importSMAONode = slaveNode.OwnerDocument.ImportNode(aocNode.exportMapXMLnode("SMSSlave_" + slv104.SlaveNum), true);
                            slaveNode.AppendChild(importSMAONode);
                        }
                        catch (System.InvalidOperationException)
                        {
                        }
                    }
                    if (dicNode != null)
                    {
                        try
                        {
                            XmlNode importSMDINode = slaveNode.OwnerDocument.ImportNode(dicNode.exportMapXMLnode("SMSSlave_" + slv104.SlaveNum), true);
                            slaveNode.AppendChild(importSMDINode);
                        }
                        catch (System.InvalidOperationException)
                        {
                        }
                    }

                    if (docNode != null)
                    {
                        try
                        {
                            XmlNode importSMDONode = slaveNode.OwnerDocument.ImportNode(docNode.exportMapXMLnode("SMSSlave_" + slv104.SlaveNum), true);
                            slaveNode.AppendChild(importSMDONode);
                        }
                        catch (System.InvalidOperationException)
                        {
                        }
                    }

                    if (encNode != null)
                    {
                        try
                        {
                            XmlNode importSMENNode = slaveNode.OwnerDocument.ImportNode(encNode.exportMapXMLnode("SMSSlave_" + slv104.SlaveNum), true);
                            slaveNode.AppendChild(importSMENNode);
                        }
                        catch (System.InvalidOperationException)
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }