コード例 #1
0
        public static SDatabase Open(string path, string fname)
        {
            if (dbfiles.Contains(fname))
            {
                return(databases[fname]
                       ?? throw new System.Exception("Database is loading"));
            }
            var db = new SDatabase(fname);

            dbfiles += (fname, new AStream(path + fname));
            db       = db.Load();
            Install(db);
            return(db);
        }
コード例 #2
0
        public static SDatabase Open(string path, string fname)
        {
            if (dbfiles.Contains(fname))
            {
                return(databases[fname]
                       ?? throw new System.Exception("Database is loading"));
            }
            var db   = new SDatabase(fname);
            var file = new FileStream(path + fname, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);

            dbfiles += (fname, file);
            db       = db.Load();
            Install(db);
            return(db);
        }