// internal static void AddDBInstance(DataBaseInstance inst) { var _instance = Kernel.GetInstance(); if (_instance.FindAll(x => x.Name == inst.Name).Count != 0) { return; } _instance.Add(inst); }
internal static void LoadDatabase(string name) { DataBaseInstance bufInst = CollectDataModule.LoadDataBase(name); if (bufInst.Name == "nullDB") { throw new ArgumentException("THere is no DB with such name in folder"); } if (GetInstance().isDatabaseExistsInList(bufInst.Name)) { GetInstance()[GetInstance().IndexOfDatabase(bufInst.Name)] = bufInst; } }
} //UI done // internal static void AddDBInstance(DataBaseInstance inst) { try { var _instance = Kernel.GetInstance(); if (_instance.FindAll(x => x.Name == inst.Name).Count != 0 || !inst.Name.isThereNoUndefinedSymbols()) { throw new ArgumentException("Invalid name of database"); } _instance.Add(inst); } catch (Exception e) { Console.WriteLine(e); } }
internal static void SaveDataBaseInstanceToFolder(this DataBaseInstance inst) { CacheModule.SaveDataBaseToFolder(inst); } //UI done
} //UI done internal static void AddDBInstance(string name) { DataBaseInstance bufInst = new DataBaseInstance(name); AddDBInstance(bufInst); } //UI done