Example #1
0
        internal static void RemoveContentAtIndexFromDatabase(int idx)
        {
            contents.RemoveAt(idx);
            ContentComparer cc = new ContentComparer();

            contents.Sort(cc);
        }
Example #2
0
        internal static void AddContentToDatabase(Content content)
        {
            contents.Add(content);
            Tools.SaveToJSON <List <Content> >(contents, path, contents_fileName);
            ContentComparer cc = new ContentComparer();

            contents.Sort(cc);
        }
Example #3
0
 internal static void LoadAllDatabases()
 {
     contents = Tools.LoadFromJSON <List <Content> >(Path.Combine(path, contents_fileName));
     if (contents == null)
     {
         contents = new List <Content>();
     }
     if (contents.Count > 2)
     {
         test();
         ContentComparer cc = new ContentComparer();
         contents.Sort(cc);
     }
     AllMenus = Tools.LoadFromJSON <List <Recipe> >(Path.Combine(path, recipe_fileName));
     if (AllMenus == null)
     {
         AllMenus = new List <Recipe>();
     }
     HistoryMenus = Tools.LoadFromJSON <List <HistoryRecipe> >(Path.Combine(path, history_fileName));
     if (HistoryMenus == null)
     {
         HistoryMenus = new List <HistoryRecipe>();
     }
 }