Example #1
0
        public XmlNode GenerateXML()
        {
            // Create XML Node and Attributes
            XmlDocument  d          = new XmlDocument();
            XmlNode      output     = d.CreateNode("element", "Action", null);
            XmlAttribute type       = d.CreateAttribute("Type");
            XmlAttribute showBack   = d.CreateAttribute("ShowBack");
            XmlAttribute showCancel = d.CreateAttribute("ShowCancel");

            // Assign attribute values
            type.Value       = ActionType;
            showBack.Value   = ShowBack.ToString();
            showCancel.Value = ShowCancel.ToString();

            // Append Attributes
            output.Attributes.Append(type);
            if (null != ShowBack)
            {
                output.Attributes.Append(showBack);
            }
            if (null != ShowCancel)
            {
                output.Attributes.Append(showCancel);
            }

            return(output);
        }
Example #2
0
        public XmlNode GenerateXML()
        {
            // Create XML Node and Attributes
            XmlDocument  d           = new XmlDocument();
            XmlNode      output      = d.CreateNode("element", "Action", null);
            XmlAttribute type        = d.CreateAttribute("Type");
            XmlAttribute showBack    = d.CreateAttribute("ShowBack");
            XmlAttribute showCancel  = d.CreateAttribute("ShowCancel");
            XmlAttribute name        = d.CreateAttribute("Name");
            XmlAttribute image       = d.CreateAttribute("Image");
            XmlAttribute infoImage   = d.CreateAttribute("InfoImage");
            XmlAttribute title       = d.CreateAttribute("Title");
            XmlAttribute centerTitle = d.CreateAttribute("CenterTitle");
            XmlAttribute condition   = d.CreateAttribute("Condition");

            // Assign attribute values
            type.Value        = "ErrorInfo";
            showBack.Value    = ShowBack.ToString();
            showCancel.Value  = ShowCancel.ToString();
            name.Value        = Name;
            image.Value       = Image;
            infoImage.Value   = InfoImage;
            title.Value       = Title;
            centerTitle.Value = CenterTitle.ToString();
            condition.Value   = Condition;

            // Append Attributes
            output.Attributes.Append(type);
            if (null != ShowBack)
            {
                output.Attributes.Append(showBack);
            }
            if (!string.IsNullOrEmpty(Name))
            {
                output.Attributes.Append(name);
            }
            if (!string.IsNullOrEmpty(Image))
            {
                output.Attributes.Append(image);
            }
            if (!string.IsNullOrEmpty(InfoImage))
            {
                output.Attributes.Append(infoImage);
            }
            if (!string.IsNullOrEmpty(Title))
            {
                output.Attributes.Append(title);
            }
            if (!string.IsNullOrEmpty(Condition))
            {
                output.Attributes.Append(condition);
            }
            output.Attributes.Append(centerTitle);

            // Set Content
            output.InnerText = Content;

            return(output);
        }
Example #3
0
        public XmlNode GenerateXML()
        {
            // Create XML Node and Attributes
            XmlDocument  d      = new XmlDocument();
            XmlNode      output = d.CreateNode("element", "Action", null);
            XmlAttribute type   = d.CreateAttribute("Type");
            XmlAttribute applicationVariableBase = d.CreateAttribute("ApplicationVariableBase");
            XmlAttribute packageVariableBase     = d.CreateAttribute("PackageVariableBase");
            XmlAttribute showBack    = d.CreateAttribute("ShowBack");
            XmlAttribute showCancel  = d.CreateAttribute("ShowCancel");
            XmlAttribute title       = d.CreateAttribute("Title");
            XmlAttribute size        = d.CreateAttribute("Size");
            XmlAttribute expanded    = d.CreateAttribute("Expanded");
            XmlAttribute centerTitle = d.CreateAttribute("CenterTitle");
            XmlAttribute condition   = d.CreateAttribute("Condition");

            // Assign attribute values
            type.Value = "AppTree";
            applicationVariableBase.Value = ApplicationVariableBase;
            packageVariableBase.Value     = PackageVariableBase;
            showBack.Value    = ShowBack.ToString();
            showCancel.Value  = ShowCancel.ToString();
            title.Value       = Title;
            size.Value        = Size;
            expanded.Value    = Expanded.ToString();
            centerTitle.Value = CenterTitle.ToString();
            condition.Value   = Condition;

            // Append Attributes
            output.Attributes.Append(type);
            if (!string.IsNullOrEmpty(ApplicationVariableBase))
            {
                output.Attributes.Append(applicationVariableBase);
            }
            if (!string.IsNullOrEmpty(PackageVariableBase))
            {
                output.Attributes.Append(packageVariableBase);
            }
            if (null != ShowBack)
            {
                output.Attributes.Append(showBack);
            }
            if (null != ShowCancel)
            {
                output.Attributes.Append(showCancel);
            }
            if (!string.IsNullOrEmpty(Title))
            {
                output.Attributes.Append(title);
            }
            if (!string.IsNullOrEmpty(Size))
            {
                output.Attributes.Append(size);
            }
            if (null != Expanded)
            {
                output.Attributes.Append(expanded);
            }
            if (!string.IsNullOrEmpty(Condition))
            {
                output.Attributes.Append(condition);
            }
            output.Attributes.Append(centerTitle);

            // Add all child nodes to the group
            XmlNode SoftwareSetsNode = d.CreateNode("element", "SoftwareSets", "");

            foreach (IElement sets in SubChildren)
            {
                XmlNode importNode = d.ImportNode(sets.GenerateXML(), true);
                SoftwareSetsNode.AppendChild(importNode);
            }
            output.AppendChild(SoftwareSetsNode);

            return(output);
        }
Example #4
0
        public XmlNode GenerateXML()
        {
            // Create XML Node and Attributes
            XmlDocument  d           = new XmlDocument();
            XmlNode      output      = d.CreateNode("element", "Action", null);
            XmlAttribute type        = d.CreateAttribute("Type");
            XmlAttribute showBack    = d.CreateAttribute("ShowBack");
            XmlAttribute showCancel  = d.CreateAttribute("ShowCancel");
            XmlAttribute name        = d.CreateAttribute("Name");
            XmlAttribute size        = d.CreateAttribute("Size");
            XmlAttribute title       = d.CreateAttribute("Title");
            XmlAttribute centerTitle = d.CreateAttribute("CenterTitle");
            XmlAttribute condition   = d.CreateAttribute("Condition");

            // Assign attribute values
            type.Value        = ActionType;
            showBack.Value    = ShowBack.ToString();
            showCancel.Value  = ShowCancel.ToString();
            name.Value        = Name;
            size.Value        = Size;
            title.Value       = Title;
            centerTitle.Value = CenterTitle.ToString();
            condition.Value   = Condition;

            // Append Attributes
            output.Attributes.Append(type);
            if (null != ShowBack)
            {
                output.Attributes.Append(showBack);
            }
            if (null != ShowCancel)
            {
                output.Attributes.Append(showCancel);
            }
            if (!string.IsNullOrEmpty(Name))
            {
                output.Attributes.Append(name);
            }
            if (!string.IsNullOrEmpty(Size))
            {
                output.Attributes.Append(size);
            }
            if (!string.IsNullOrEmpty(Title))
            {
                output.Attributes.Append(title);
            }
            if (!string.IsNullOrEmpty(Condition))
            {
                output.Attributes.Append(condition);
            }
            output.Attributes.Append(centerTitle);

            // Append Children
            foreach (IChildElement input in SubChildren)
            {
                XmlNode importNode = d.ImportNode(input.GenerateXML(), true);
                output.AppendChild(importNode);
            }

            return(output);
        }
Example #5
0
        public XmlNode GenerateXML()
        {
            // Create XML Node and Attributes
            XmlDocument  d                 = new XmlDocument();
            XmlNode      output            = d.CreateNode("element", "Action", null);
            XmlAttribute type              = d.CreateAttribute("Type");
            XmlAttribute showBack          = d.CreateAttribute("ShowBack");
            XmlAttribute showCancel        = d.CreateAttribute("ShowCancel");
            XmlAttribute title             = d.CreateAttribute("Title");
            XmlAttribute showOnFailureOnly = d.CreateAttribute("ShowOnFailureOnly");
            XmlAttribute size              = d.CreateAttribute("Size");
            XmlAttribute timeout           = d.CreateAttribute("Timeout");
            XmlAttribute timeoutAction     = d.CreateAttribute("TimeoutAction");
            XmlAttribute centerTitle       = d.CreateAttribute("CenterTitle");
            XmlAttribute condition         = d.CreateAttribute("Condition");

            // Assign attribute values
            type.Value              = ActionType;
            showBack.Value          = ShowBack.ToString();
            showCancel.Value        = ShowCancel.ToString();
            title.Value             = Title;
            showOnFailureOnly.Value = ShowOnFailureOnly.ToString();
            size.Value              = Size;
            timeout.Value           = Timeout.ToString();
            if (TimeoutAction == "Custom")
            {
                timeoutAction.Value = TimeoutReturnCode.ToString();
            }
            else
            {
                timeoutAction.Value = TimeoutAction;
            }
            centerTitle.Value = CenterTitle.ToString();
            condition.Value   = Condition;

            // Append Attributes
            output.Attributes.Append(type);
            if (null != ShowBack)
            {
                output.Attributes.Append(showBack);
            }
            if (null != ShowCancel)
            {
                output.Attributes.Append(showCancel);
            }
            if (!string.IsNullOrEmpty(Title))
            {
                output.Attributes.Append(title);
            }
            if (null != ShowOnFailureOnly)
            {
                output.Attributes.Append(showOnFailureOnly);
            }
            if (!string.IsNullOrEmpty(Size))
            {
                output.Attributes.Append(size);
            }
            if (null != Timeout)
            {
                output.Attributes.Append(timeout);
            }
            if (!string.IsNullOrEmpty(TimeoutAction))
            {
                output.Attributes.Append(timeoutAction);
            }
            if (!string.IsNullOrEmpty(Condition))
            {
                output.Attributes.Append(condition);
            }
            output.Attributes.Append(centerTitle);

            // Append Children
            foreach (Check check in SubChildren)
            {
                XmlNode importNode = d.ImportNode(check.GenerateXML(), true);
                output.AppendChild(importNode);
            }

            return(output);
        }