コード例 #1
0
        public static MasterFile Open(IPersistenceManager persistenceManager, string directoryPath)
        {
            var masterFilePath = Path.Combine(directoryPath, MasterFileName);

            if (!persistenceManager.FileExists(masterFilePath))
            {
                throw new StoreManagerException(directoryPath, "Master file not found");
            }
            var mf = new MasterFile(persistenceManager, directoryPath, masterFilePath,
                                    StoreConfiguration.DefaultStoreConfiguration, Guid.Empty);

            using (var mfStream = persistenceManager.GetInputStream(masterFilePath))
            {
                mf.Load(mfStream);
            }
            return(mf);
        }
コード例 #2
0
        public static MasterFile Open(IPersistenceManager persistenceManager, string directoryPath)
        {
            var masterFilePath = Path.Combine(directoryPath, MasterFileName);
            var mf             = new MasterFile(persistenceManager, directoryPath, masterFilePath,
                                                StoreConfiguration.DefaultStoreConfiguration, Guid.Empty);

            try
            {
                using (var mfStream = persistenceManager.GetInputStream(masterFilePath))
                {
                    mf.Load(mfStream);
                }
            }
            catch (Exception ex)
            {
                throw new StoreManagerException(directoryPath, "Error opening master file. " + ex.Message);
            }
            return(mf);
        }
コード例 #3
0
ファイル: MasterFile.cs プロジェクト: Garwin4j/BrightstarDB
 public static MasterFile Open(IPersistenceManager persistenceManager, string directoryPath)
 {
     var masterFilePath = Path.Combine(directoryPath, MasterFileName);
     if (!persistenceManager.FileExists(masterFilePath))
     {
         throw new StoreManagerException(directoryPath, "Master file not found");
     }
     var mf = new MasterFile(persistenceManager, directoryPath, masterFilePath,
                             StoreConfiguration.DefaultStoreConfiguration, Guid.Empty);
     using (var mfStream = persistenceManager.GetInputStream(masterFilePath))
     {
         mf.Load(mfStream);
     }
     return mf;
 }
コード例 #4
0
ファイル: MasterFile.cs プロジェクト: jaensen/BrightstarDB
 public static MasterFile Open(IPersistenceManager persistenceManager, string directoryPath)
 {
     var masterFilePath = Path.Combine(directoryPath, MasterFileName);
     var mf = new MasterFile(persistenceManager, directoryPath, masterFilePath,
                             StoreConfiguration.DefaultStoreConfiguration, Guid.Empty);
     try
     {
         using (var mfStream = persistenceManager.GetInputStream(masterFilePath))
         {
             mf.Load(mfStream);
         }
     }
     catch (Exception ex)
     {
         throw new StoreManagerException(directoryPath, "Error opening master file. " + ex.Message);
     }
     return mf;
 }