예제 #1
0
        /// <summary>
        /// Loads the settings from the XML node.
        /// </summary>
        public void LoadFromXml(XmlNode xmlNode)
        {
            if (xmlNode == null)
            {
                throw new ArgumentNullException("xmlNode");
            }

            InstanceID = xmlNode.GetChildAsInt("InstanceID");
            Name       = xmlNode.GetChildAsString("Name");
            WebUrl     = xmlNode.GetChildAsString("WebUrl");

            if (xmlNode.SelectSingleNode("ConnectionSettings") is XmlNode connectionSettingsNode)
            {
                ConnectionSettings.LoadFromXml(connectionSettingsNode);
            }

            if (xmlNode.SelectSingleNode("DownloadSettings") is XmlNode downloadSettingsNode)
            {
                DownloadSettings.LoadFromXml(downloadSettingsNode);
            }

            if (xmlNode.SelectSingleNode("UploadSettings") is XmlNode uploadSettingsNode)
            {
                UploadSettings.LoadFromXml(uploadSettingsNode);
            }
        }
예제 #2
0
        /// <summary>
        /// Loads the settings from the XML node.
        /// </summary>
        public void LoadFromXml(XmlNode xmlNode)
        {
            if (xmlNode == null)
            {
                throw new ArgumentNullException("xmlNode");
            }

            Name = xmlNode.GetChildAsString("Name");

            XmlNode connectionSettingsNode = xmlNode.SelectSingleNode("ConnectionSettings");

            if (connectionSettingsNode != null)
            {
                ConnectionSettings.LoadFromXml(connectionSettingsNode);
            }

            XmlNode downloadSettingsNode = xmlNode.SelectSingleNode("DownloadSettings");

            if (downloadSettingsNode != null)
            {
                DownloadSettings.LoadFromXml(downloadSettingsNode);
            }

            XmlNode uploadSettingsNode = xmlNode.SelectSingleNode("UploadSettings");

            if (uploadSettingsNode != null)
            {
                UploadSettings.LoadFromXml(uploadSettingsNode);
            }
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 public DeploymentProfile()
 {
     Name               = "";
     WebUrl             = "";
     ConnectionSettings = new ConnectionSettings()
     {
         ScadaInstance = ""
     };
     DownloadSettings = new DownloadSettings();
     UploadSettings   = new UploadSettings();
 }
예제 #4
0
        /// <summary>
        /// Saves the settings into the XML node.
        /// </summary>
        public void SaveToXml(XmlElement xmlElem)
        {
            if (xmlElem == null)
            {
                throw new ArgumentNullException("xmlElem");
            }

            xmlElem.AppendElem("Name", Name);
            ConnectionSettings.SaveToXml(xmlElem.AppendElem("ConnectionSettings"));
            DownloadSettings.SaveToXml(xmlElem.AppendElem("DownloadSettings"));
            UploadSettings.SaveToXml(xmlElem.AppendElem("UploadSettings"));
        }