Inheritance: IDisposable
示例#1
0
 public static void Initialize(string envDir, string dbFile)
 {
     if (!s_Initialized) {
         lock (s_syncRoot) {
             if (!s_Initialized) {
                 BDB46.Env env = new BDB46.Env (envDir);
                 BDB46 storage = new BDB46 (dbFile, true, DBFormat.Recno, false, env);
                 s_Storage = storage;
             }
         }
     }
 }
示例#2
0
 public BDB46 Get(string name, DBFormat format)
 {
     if (!m_Storage.ContainsKey (name)) {
         if (m_StorageLock.WaitOne ()) {
             if (!m_Storage.ContainsKey (name)) {
                 string file = Path.Combine (Paths.ApplicationData, String.Format ("{0}.db", name));
                 var env = new BDB46.Env (Paths.ApplicationData);
                 var storage = new BDB46 (file, true, format, false, env);
                 m_Storage [name] = storage;
             }
         }
     }
     return m_Storage [name];
 }