Пример #1
0
        public static bool Open(string model)
        {
            IDB db = new DbLite(model, dbMode.OPEN);

            if (db.isOpen())
            {
                if (!dicDB.ContainsKey(model))
                {
                    dicDB.Add(model, db);
                }
                return(true);
            }
            return(false);
        }
Пример #2
0
        public static void Init()
        {
            string path = AppDomain.CurrentDomain.BaseDirectory;

            string[] files = Directory.GetFiles(path, "*.db").Select(x => Path.GetFileName(x)).ToArray();
            foreach (string m in files)
            {
                string mi = m.Substring(0, m.Length - 3).ToLower();
                IDB    db = new DbLite(mi, dbMode.OPEN);
                if (db.isOpen())
                {
                    dicDB.Add(mi, db);
                }
            }
        }