예제 #1
0
        //public List<ScriptParameter> Parameters { get; set; }

        public XmlNode ToXmlNode()
        {
            XmlDocument xdoc = new XmlDocument();

            xdoc.LoadXml("<actionScript><scriptText /></actionScript>");
            //xdoc.DocumentElement.SetAttributeValue("id", Id);
            xdoc.DocumentElement.SetAttributeValue("name", Name);
            xdoc.DocumentElement.SetAttributeValue("type", ScriptType.ToString());
            xdoc.DocumentElement.SetAttributeValue("description", Description);
            xdoc.DocumentElement.SetAttributeValue("windowStyle", WindowSizeStyle.ToString());
            xdoc.DocumentElement.SetAttributeValue("adminMode", RunAdminMode);
            xdoc.DocumentElement.SetAttributeValue("correctiveErrorScript", IsErrorCorrectiveScript);
            xdoc.DocumentElement.SetAttributeValue("correctiveWarningScript", IsWarningCorrectiveScript);
            xdoc.DocumentElement.SetAttributeValue("restorationScript", IsRestorationScript);
            XmlNode scriptTextNode = xdoc.DocumentElement.SelectSingleNode("scriptText");

            scriptTextNode.InnerText = Script;
            //XmlNode parametersNode = xdoc.DocumentElement.SelectSingleNode("parameters");
            //foreach (ScriptParameter parameter in Parameters)
            //{
            //    XmlNode parameterNode = xdoc.ImportNode(parameter.ToXmlNode(), true);
            //    parametersNode.AppendChild(parameterNode);
            //}

            return(xdoc.DocumentElement);
        }
예제 #2
0
        public string ToXml()
        {
            XmlDocument xdoc = new XmlDocument();

            xdoc.LoadXml("<script />");
            xdoc.DocumentElement.SetAttributeValue("name", Name);
            xdoc.DocumentElement.SetAttributeValue("type", ScriptType.ToString());
            xdoc.DocumentElement.SetAttributeValue("description", Description);
            xdoc.DocumentElement.SetAttributeValue("windowStyle", WindowSizeStyle.ToString());
            xdoc.DocumentElement.SetAttributeValue("adminMode", RunAdminMode);

            xdoc.DocumentElement.InnerText = Script;

            return(xdoc.DocumentElement.OuterXml);
        }