Example #1
0
        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);
        }
Example #2
0
 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;
         }
     }
 }
Example #3
0
        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();
        }