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]); }
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(); }