示例#1
0
        public void Save() {
            XMLSerializer.Serialize<List<CategoryData>>(Path.Combine(DataDir, categoryfile), categorylist);

            var lists = manager.ToList();
            foreach (var item in lists) {
                if (item.Value.IsDirty) {
                    var name = getCategoryName(item.Key);
                    XMLSerializer.Serialize<List<Data>>(Path.Combine(DataDir, name + Category.Ext), item.Value.Datas);
                }
            }
        }
示例#2
0
 public void LoadSnippetList()
 {
     if (File.Exists(SnippetListPath))
     {
         SnippetList = XMLSerializer.Deserialize <List <string> >(SnippetListPath, new List <string>());
     }
     else
     {
         SnippetList = new List <string>();
     }
 }
示例#3
0
 public void Load() {
     categorylist = XMLSerializer.Deserialize<List<CategoryData>>(Path.Combine(DataDir, categoryfile), new List<CategoryData>() { new CategoryData() { ID = 0, Name = "Trust" } });
     foreach (var item in categorylist) {
         var name = item.Name;
         var m = new ItemManager();
         m.Datas = XMLSerializer.Deserialize<List<Data>>(Path.Combine(DataDir, name + Category.Ext), new List<Data>());
         m.CategoryID = item.ID;
         m.eventHandler += eventHandler;
         datalist.AddRange(m.Datas);
         manager.Add(item.ID, m);
     }
     datalist.Sort(new IDComparer());
 }
示例#4
0
 public void SaveSnippetList()
 {
     XMLSerializer.Serialize <List <string> >(SnippetListPath, SnippetList);
 }