Beispiel #1
0
        public void Open(string filename)
        {
            if (db != null)
            {
                throw new Exception(string.Format("The database file '{0}' is already open", dbFilename));
            }

            lock ( dbLock )
            {
                db = DatabaseFactory.CreateDatabase();
                db.Open(filename);

                if (db.Root == null)
                {
                    // Only create root the first time
                    db.Root = new DatabaseRoot();
                }
                dbRoot = (DatabaseRoot)db.Root;
                CheckAndCreateIndexes();
                dbFilename = filename;
                isDbOpen   = true;
            }
        }
        public void Open(string filename)
        {
            if ( db != null )
            {
                throw new Exception( string.Format( "The database file '{0}' is already open", dbFilename ) );
            }

            lock ( dbLock )
            {
                db = DatabaseFactory.CreateDatabase();
                db.Open( filename );

                if ( db.Root == null )
                {
                    // Only create root the first time
                    db.Root = new DatabaseRoot();
                }
                dbRoot = (DatabaseRoot) db.Root;
                CheckAndCreateIndexes();
                dbFilename = filename;
                isDbOpen = true;
            }
        }