public static NestDirectory Deserialize(string path) { NestDirectory result = null; XmlSerializer serializer = new XmlSerializer(typeof(NestDirectory)); using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) { result = serializer.Deserialize(fs) as NestDirectory; } return(result); }
private static void GetChildrenNameList(NestDirectory dir, List <string> nameList, bool isNest = false) { foreach (var item in dir.Children) { if (isNest) { GetChildrenNameList(item, nameList, isNest); } if (nameList.Contains(item.Name)) { continue; } } }
private void SettingGroups_Load(object sender, EventArgs e) { string path = GetXmlPath(); if (File.Exists(path)) { NDirectory = StatsisLib.NestDirectory.Deserialize(path); } else { NDirectory = new StatsisLib.NestDirectory() { Name = "全部", OrderIndex = 1 }; } InitTree(NDirectory); mapperInfos = new List <MappInfo>(); InitMapper(); }