コード例 #1
0
ファイル: Guess.cs プロジェクト: viceroypenguin/volante
    static public void Main(System.String[] args)
    {
        IDatabase db = DatabaseFactory.CreateDatabase();

        Rc4File dbFile = new Rc4File("guess.db", "GUESS");

        db.Open(dbFile, 4 * 1024 * 1024);
        Guess root = (Guess)db.Root;

        while (askQuestion("Think of an animal. Ready (y/n) ? "))
        {
            if (root == null)
            {
                root    = whoIsIt(null);
                db.Root = root;
            }
            else
            {
                root.dialog();
            }
            db.Commit();
        }

        System.Console.WriteLine("End of the game");
        db.Close();
    }
コード例 #2
0
ファイル: StorageImpl.cs プロジェクト: kjk/tenderbase
 public virtual void Open(string filePath, int pagePoolSize, string cryptKey)
 {
     lock (this)
     {
         Rc4File file = new Rc4File(filePath, readOnly, noFlush, cryptKey);
         try
         {
             Open(file, pagePoolSize);
         }
         catch (StorageError ex)
         {
             file.Close();
             throw ex;
         }
     }
 }