コード例 #1
0
 public IStorageContext GetStorageContext(InformationUnitType informationUnitType)
 {
     if (!_storageContexts.ContainsKey(informationUnitType))
     {
         lock (_contextsLock) {
             if (!_storageContexts.ContainsKey(informationUnitType))
             {
                 _storageContexts[informationUnitType] = Factory.Shared.Factory.Create <IStorageContext>("SessionStorageContext");
                 if (!_storageContexts[informationUnitType].TryToInitialize(informationUnitType.ToString(), StorageMediaFactory.DefaultMedia))
                 {
                     throw new Exception("There was an error building the default storage context based on default media.");
                 }
             }
         }
     }
     return(_storageContexts[informationUnitType]);
 }
コード例 #2
0
ファイル: Context.cs プロジェクト: RomanS2N/trading
        public IStorageContext GetStorageContext(InformationUnitType informationUnitType)
        {
            //if (!_storageContexts.ContainsKey(informationUnitType)) {
            //    lock (_contextsLock) {
            //        if (!_storageContexts.ContainsKey(informationUnitType)) {
            //            string key = ContextType.ToString() + "StorageContext";
            //            _storageContexts[informationUnitType] = Factory.Shared.Factory.Create<IStorageContext>(key);
            //            if (!_storageContexts[informationUnitType].TryToInitialize(informationUnitType.ToString(), StorageMediaFactory.DefaultMedia)) {
            //                throw new Exception("There was an error building the default storage context based on default media.");
            //            }
            //        }
            //    }
            //}
            //return _storageContexts[informationUnitType];

            throw new NotImplementedException();
        }