public void InitMeta() { FileUtil.GetCurPath(); string xmlpath = FileUtil.GetPath(FileUtil.GetCurPath(), ProMetaConst.XML_SUBDIR); List <string> buildorder = new List <string>(); { string ord = FileUtil.GetFile(xmlpath, ProMetaConst.XML_ANALYSEORDER); if (FileUtil.IsFileExist(ord)) { XmlUtil xu = new XmlUtil(ord); List <XmlElement> mls = XmlUtil.GetChildrenElement(xu.Root, "xml"); foreach (XmlElement e1 in mls) { buildorder.Add(XmlUtil.GetElementText(e1)); } } } List <ProRegion> pros = new List <ProRegion>(); { List <string> allxml = FileUtil.ListFilesOfDir(xmlpath, "*.xml"); foreach (string xml in allxml) { string p = FileUtil.GetFile(xmlpath, xml); try { XmlUtil xu = new XmlUtil(p); ProRegion pr = new ProRegion(xu); pr.RegionName = FileUtil.GetFileNameWithoutExtension(p); pros.Add(pr); } catch (Exception se) { LoggerHelper.GenError(String.Format("{0} analyse failed............(X)", xml)); throw se; } } } //sort for (int ind = buildorder.Count - 1; ind >= 0; --ind) { foreach (ProRegion r in pros) { if (r.RegionName == buildorder[ind]) { pros.Remove(r); pros.Insert(0, r); break; } } } //load foreach (ProRegion r in pros) { try { r.AnalyseProRegion(); this.AddProRegion(r); } catch (Exception se) { LoggerHelper.GenError(String.Format("{0} analyse failed............(X)", r.Xml)); throw se; } } }