//
        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;
            }
        }
Beispiel #3
0
        } //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);
            }
        }
Beispiel #4
0
 internal static void SaveDataBaseInstanceToFolder(this DataBaseInstance inst)
 {
     CacheModule.SaveDataBaseToFolder(inst);
 } //UI done
Beispiel #5
0
        } //UI done

        internal static void AddDBInstance(string name)
        {
            DataBaseInstance bufInst = new DataBaseInstance(name);

            AddDBInstance(bufInst);
        } //UI done