예제 #1
0
        /// <summary>
        /// Loads the configuration from the XML node.
        /// </summary>
        public void LoadFromXml(XmlElement xmlElem)
        {
            if (xmlElem == null)
            {
                throw new ArgumentNullException(nameof(xmlElem));
            }

            Active    = xmlElem.GetAttrAsBool("active");
            Name      = xmlElem.GetAttrAsString("name");
            ProxyMode = xmlElem.GetChildAsBool("ProxyMode");
            Directory = xmlElem.GetChildAsString("Directory");

            if (xmlElem.SelectSingleNode("AdminUser") is XmlNode adminUserNode)
            {
                AdminUser.LoadFromXml(adminUserNode);
            }

            if (xmlElem.SelectSingleNode("AgentUser") is XmlNode agentUserNode)
            {
                AgentUser.LoadFromXml(agentUserNode);
            }
        }