Пример #1
0
        /// <summary>
        /// 加载主机站点信息
        /// </summary>
        /// <param name="node"></param>
        public override void Load(System.Xml.XmlElement node)
        {
            base.Load(node);

            XmlNodeList _siteNodeList = node.SelectNodes("MaSite");

            foreach (XmlElement item in _siteNodeList)
            {
                IMaSite _site = MaConfigManager.LoadConfig(item) as IMaSite;
                if (_site != null)
                {
                    #region 设置站点主机头

                    //设置站点主机头
                    XmlNodeList _hostNodeList = item.SelectNodes("host");
                    foreach (XmlElement host in _hostNodeList)
                    {
                        if (host.Attributes["value"] != null &&
                            !string.IsNullOrEmpty(host.Attributes["value"].Value))
                        {
                            _site.SetHost(host.Attributes["value"].Value);
                        }
                    }

                    #endregion
                    m_maSiteConfigList.Add(_site);
                }
                else
                {
                    throw new Exception("站点信息配置错误:" + item.Name + ":" + item.OuterXml);
                }
            }
        }