Exemplo n.º 1
0
        public bool LoadConfigure()
        {
            try
            {
                XmlDocument xmldoc = new XmlDocument();
                xmldoc.Load(AppDomain.CurrentDomain.BaseDirectory + "\\PTConfigure.xml");

                XmlElement xmlRoot = xmldoc.SelectSingleNode("PTConfigure") as XmlElement;

                string saveRoot = xmlRoot.GetAttribute("SaveRoot");

                if (!string.IsNullOrEmpty(saveRoot))
                {
                    SaveRoot = saveRoot;
                }

                XmlNodeList nodeList = xmldoc.SelectNodes("PTConfigure/ConfigureMain");

                foreach (XmlNode node in nodeList)
                {
                    ConfigureMain cm = new ConfigureMain(node as XmlElement);
                    ConfigureMainList.Add(cm.Name, cm);
                }

                return(true);
            }
            catch (Exception ex)
            {
                Logger.Instance.Error(ex.ToString());
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool Load()
        {
            if (this.configure.ConfigureMainList.ContainsKey(ConfigureMainName))
            {
                ConfigureMain cm = this.configure.ConfigureMainList[ConfigureMainName];

                foreach (ConfigureGroup cg in cm.ConfigureGroupList)
                {
                    foreach (ConfigureItem ci in cg.ConfigureItemList)
                    {
                        this.UpdateMode = ci.Update;

                        PageInfo pi = new PageInfo();
                        pi.Url = ci.Url;
                        pi.ConfigureGroupName = cg.Name;
                        pi.ConfigureItemName  = ci.Name;

                        mSaveToDirectory = new DirectoryInfo(this.configure.SaveRoot + "\\" + cg.Name + "\\" + ci.Name);

                        pi.SaveDirectory = mSaveToDirectory.FullName;

                        mPageInfoList.Add(pi);
                    }
                }

                return(true);
            }

            return(false);
        }