Beispiel #1
0
        private void ConfigureContextManager()
        {
            IContextStore contextStore = this.Configuration.GetSetting <IContextStore>();

            ContextManager.GlobalContainer = this.container;
            ContextManager.SetContextStore(contextStore);
        }
 public WcfServiceLocatorStore(IContextStore store)
 {
     AddStore <IContextStore>(store);
     AddStore <IResolutionStore>(new WcfResolutionStore());
     AddStore <IExecutionStore>(WcfContextExecutionStore.New(this));
     AddStore <IAwarenessStore>(new AwarenessStore());
     AddStore <IInjectionOverrideStore>(new InjectionOverrideStore());
 }
 public ThreadedServiceLocatorStore(IContextStore store)
 {
     AddStore <IContextStore>(store);
     AddStore <IResolutionStore>(new ThreadedResolutionStore());
     AddStore <IExecutionStore>(ThreadedExecutionStore.New(this));
     AddStore <IAwarenessStore>(new AwarenessStore());
     AddStore <IInjectionOverrideStore>(new InjectionOverrideStore());
 }
Beispiel #4
0
 public static void Destruct(this IContextStore store)
 {
     foreach (var dep in store.GetContextInstances())
     {
         dep.Cleaner?.Destruct(dep.Key, dep.Instance);
     }
     store.GetContextInstances().Clear();
 }
Beispiel #5
0
 public static ConcurrentDictionary <DependencyRegistration, object> GetConcurrentContextInstances(
     this IContextStore store)
 {
     lock (store)
     {
         if (!(store[CTX_INSTANCES_KEY_CONCURRENT] is ConcurrentDictionary <DependencyRegistration, object> regs))
         {
             store[CTX_INSTANCES_KEY_CONCURRENT] = regs = new ConcurrentDictionary <DependencyRegistration, object>();
         }
         return(regs);
     }
 }
Beispiel #6
0
 public ThreadedServiceLocatorStore(IContextStore store)
 {
     AddStore <IContextStore>(store);
     AddStore <IResolutionStore>(new ThreadedResolutionStore());
     AddStore <IExecutionStore>(ThreadedExecutionStore.New(this));
 }
 public static void SetContextStore(IContextStore contextStore)
 {
     store = contextStore;
 }
Beispiel #8
0
 public BreadCrumbProvider(IContextStore store)
 {
     this.store = store;
 }
 public LoginStatusContextStore(IContextStore context)
 {
     this.context = context;
 }
Beispiel #10
0
        // This constructor is used by the MVC framework to instantiate the controller using
        // the default forms authentication and membership providers.

        public AccountController(IContextStore contextStore)
            : this(null, null)
        {
            this.contextStore = contextStore;
        }
 public BookListProvider(IContextStore store)
 {
     this.store = store;
 }
Beispiel #12
0
 public HttpServiceLocatorStore(IContextStore store)
 {
     AddStore <IContextStore>(store);
     AddStore <IResolutionStore>(new HttpResolutionStore());
     AddStore <IExecutionStore>(HttpContextExecutionStore.New(this));
 }
 public RecentlyViewedProvider(IContextStore store, ISavedItemsProvider savedItemsProvider)
 {
     this.store = store;
     this.savedItemsProvider = savedItemsProvider;
 }
 public CatgoryMenuContextStore(IContextStore context)
 {
     this.context = context;
 }
Beispiel #15
0
 public LatestBooksProvider(IContextStore store, ISavedItemsProvider savedItemsProvider)
 {
     this.store = store;
     this.savedItemsProvider = savedItemsProvider;
 }
Beispiel #16
0
 public static IList <ContextStoreDependency> GetContextInstances(this IContextStore store)
 {
     return((IList <ContextStoreDependency>)
                (store["__OR_CTX_INSTANCES_KEY"] ?? (store["__OR_CTX_INSTANCES_KEY"] = new List <ContextStoreDependency>())));
 }
Beispiel #17
0
 public static T Get <T>(this IContextStore source, string name)
 {
     return((T)source.Get(name));
 }
Beispiel #18
0
 public SavedItemsProvider(IContextStore contextStore)
 {
     this.contextStore = contextStore;
 }
Beispiel #19
0
 // This constructor is used by the MVC framework to instantiate the controller using
 // the default forms authentication and membership providers.
 public AccountController(IContextStore contextStore)
     : this(null, null)
 {
     this.contextStore = contextStore;
 }
Beispiel #20
0
 public static ConcurrentDictionary <DependencyRegistration, object> GetConcurrentContextInstances(this IContextStore store)
 {
     lock (store)
     {
         return(store.GetOrAdd(CTX_INSTANCES_KEY_CONCURRENT,
                               () => new ConcurrentDictionary <DependencyRegistration, object>()));
     }
 }
Beispiel #21
0
 public static IBootstrapper ConfigureWith(this IBootstrapper bootstrapper, IContextStore contextStore)
 {
     bootstrapper.Configuration.SetSettingInstance(contextStore);
     return(bootstrapper);
 }
 public CurrentCategoryProvider(IContextStore store)
 {
     this.store = store;
 }
Beispiel #23
0
 public BooksOfTheWeekProvider(IContextStore context, ISavedItemsProvider savedItemsProvider)
 {
     this.context            = context;
     this.savedItemsProvider = savedItemsProvider;
 }
Beispiel #24
0
 public HttpServiceLocator(IServiceLocatorAdapter serviceLocator, IContextStore store)
     : this(serviceLocator, new HttpServiceLocatorStore(store))
 {
 }
Beispiel #25
0
 public HttpServiceLocator(IServiceLocatorAdapter serviceLocator, IContextStore store)
     : this(serviceLocator, new HttpServiceLocatorStore(store))
 {
 }
 void StoreInstanceInContext(IContextStore contextStore, string key, object instance)
 {
     contextStore[key] = instance;
     contextStore.GetContextInstances().Add(new ContextStoreDependency(key, instance, Resolver.Registrations));
 }
 void StoreInstanceInContext(IContextStore contextStore, string key, object instance)
 {
     contextStore[key] = instance;
     contextStore.GetContextInstances().Add(new ContextStoreDependency(key, instance, Resolver.Registrations));
 }
Beispiel #28
0
 public CartProvider(IContextStore store)
 {
     this.store = store;
 }