コード例 #1
0
        public override void WriteXml(ref XmlElement parent)
        {
            //Create a new Tag node.
            XmlElement tagElement = parent.OwnerDocument.CreateElement("Tag");

            tagElement.SetAttribute("Name", Name);
            tagElement.SetAttribute("Description", Description);
            tagElement.SetAttribute("DataType", DataType.ToString());
            tagElement.SetAttribute("Address", Address);
            tagElement.SetAttribute("Driver", Driver.Id);

            tagElement.SetAttribute("Dsn", Dsn);
            tagElement.SetAttribute("SqlCommand", SqlCommand);

            tagElement.SetAttribute("OnChange", OnChange.ToString());
            tagElement.SetAttribute("OnOpen", OnOpen.ToString());
            tagElement.SetAttribute("OnClose", OnClose.ToString());

            foreach (DataRow param in _sqlParams.Rows)
            {
                XmlElement paramElement = parent.OwnerDocument.CreateElement("SqlParam");
                paramElement.SetAttribute("Name", param["Name"].ToString());
                paramElement.SetAttribute("Value", param["Value"].ToString());

                tagElement.AppendChild(paramElement);
            }

            parent.AppendChild(tagElement);
        }