Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
0
 public void LoadSnippetList()
 {
     if (File.Exists(SnippetListPath))
     {
         SnippetList = XMLSerializer.Deserialize <List <string> >(SnippetListPath, new List <string>());
     }
     else
     {
         SnippetList = new List <string>();
     }
 }
Exemplo n.º 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());
 }
Exemplo n.º 4
0
 public void SaveSnippetList()
 {
     XMLSerializer.Serialize <List <string> >(SnippetListPath, SnippetList);
 }