コード例 #1
0
        public FactoryResolutionPipeline(Foundation foundation, IServiceLocatorAdapter adapter, IServiceLocatorStore store)
        {
            var pipeline = new PostResolutionPipeline(foundation, adapter, store);

            Add(new ConditionalPipelineItem(foundation, adapter, store, pipeline));
            Add(new DefaultPipelineItem(foundation, adapter, store, pipeline));
        }
コード例 #2
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var mappedFromType = registration.GetMappedFromType();
            var mappedToType   = registration.GetMappedToType();

            if (mappedFromType != mappedToType)
            {
                adapter.RegisterFactoryMethod(mappedFromType, () => pipeline.Execute(mappedFromType));
                RegisterLazy(adapter, mappedFromType, pipeline);
                adapter.Register(mappedToType, mappedToType);
                RegisterContextual(adapter, mappedToType);
            }
            else
            {
                var serviceLocator = adapter.GetInstance <IServiceLocator>();
                adapter.RegisterFactoryMethod(mappedToType, () =>
                {
                    var instance = serviceLocator.GetInstance(mappedToType, "default." + mappedToType, new IResolutionArgument[0]);
                    return(instance);
                });
                serviceLocator.Register(new NamedRegistration(mappedToType, mappedToType, "default." + mappedToType));
            }

            RegisterLazy(adapter, mappedToType, pipeline);
            RegisterTypeResolver(adapter, mappedFromType);
            RegisterContextual(adapter, mappedFromType);
        }
コード例 #3
0
        protected static List <object> MergeContextItems(IServiceLocatorStore context)
        {
            var contextItems    = new List <object>();
            var stores          = context.All <IResolutionStore>().ToList();
            var resolutionItems = new List <IResolutionArgument>();

            stores.ForEach(x => resolutionItems.AddRange(x.Items));

            for (int i = 0; i < resolutionItems.Count; i++)
            {
                var argument = resolutionItems[i];
                if (argument is ContextArgument)
                {
                    contextItems.Add(((ContextArgument)argument).ContextItem);
                }
            }

            foreach (IContextStore contextStore in context.All <IContextStore>())
            {
                var items = contextStore.Items;

                for (int i = 0; i < items.Count; i++)
                {
                    var item = items[i];
                    contextItems.Add(item);
                }
            }

            return(contextItems);
        }
コード例 #4
0
        protected static List<object> MergeContextItems(IServiceLocatorStore context)
        {
            var contextItems = new List<object>();
            var stores = context.All<IResolutionStore>().ToList();
            var resolutionItems = new List<IResolutionArgument>();

            stores.ForEach(x => resolutionItems.AddRange(x.Items));

            for (int i = 0; i < resolutionItems.Count; i++)
            {
                var argument = resolutionItems[i];
                if (argument is ContextArgument) contextItems.Add(((ContextArgument) argument).ContextItem);
            }

            foreach (IContextStore contextStore in context.All<IContextStore>())
            {
                var items = contextStore.Items;

                for (int i = 0; i < items.Count; i++)
                {
                    var item = items[i];
                    contextItems.Add(item);
                }
            }

            return contextItems;
        }
コード例 #5
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var mappedFromType = registration.GetMappedFromType();
            var mappedToType = registration.GetMappedToType();

            if (mappedFromType != mappedToType)
            {
                adapter.RegisterFactoryMethod(mappedFromType, () => pipeline.Execute(mappedFromType));
                RegisterLazy(adapter, mappedFromType, pipeline);
                adapter.Register(mappedToType, mappedToType);
                RegisterContextual(adapter, mappedToType);
            }
            else
            {
                var serviceLocator = adapter.GetInstance<IServiceLocator>();
                adapter.RegisterFactoryMethod(mappedToType, () =>
                {
                    var instance = serviceLocator.GetInstance(mappedToType, "default." + mappedToType, new IResolutionArgument[0]);
                    return instance;
                });
                serviceLocator.Register(new NamedRegistration(mappedToType, mappedToType, "default." + mappedToType));
            }

            RegisterLazy(adapter, mappedToType, pipeline);
            RegisterTypeResolver(adapter, mappedFromType);
            RegisterContextual(adapter, mappedFromType);
        }
コード例 #6
0
 private ThreadedExecutionStore(IServiceLocatorStore store)
 {
     this.store     = store;
     RequestedTypes = new List <Type>();
     index          = 0;
     store.SetStore <IResolutionStore>(new ThreadedResolutionStore());
 }
コード例 #7
0
        protected ServiceLocator(IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store)
        {
            this.serviceLocator    = serviceLocator;
            this.store             = store;
            foundation             = new Foundation();
            pipeline               = new DefaultResolutionPipeline(foundation, serviceLocator, this.store);
            factoryPipeline        = new FactoryResolutionPipeline(foundation, serviceLocator, this.store);
            postResolutionPipeline = new PostResolutionPipeline(foundation, serviceLocator, store);

            registrationTemplate = new DefaultMetaRegistrationTemplate(serviceLocator);

            serviceLocator.Register(typeof(Transient), typeof(Transient));
            serviceLocator.Register(typeof(Singleton), typeof(Singleton));
            serviceLocator.RegisterInstance(typeof(IServiceLocatorAdapter), serviceLocator);
            serviceLocator.RegisterInstance(typeof(IServiceLocator), this);
            serviceLocator.RegisterInstance(typeof(Microsoft.Practices.ServiceLocation.IServiceLocator), this);
            serviceLocator.RegisterInstance(typeof(Foundation), this.foundation);
            serviceLocator.RegisterInstance(typeof(IServiceLocatorStore), this.store);
            serviceLocator.RegisterInstance(typeof(IContextStore), this.store.Get <IContextStore>());
            serviceLocator.RegisterInstance(typeof(IExecutionStore), this.store.Get <IExecutionStore>());
            serviceLocator.RegisterInstance(typeof(IResolutionStore), this.store.Get <IResolutionStore>());

            var binPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath
                          ?? AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            Register(Load.FromAssembliesIn(binPath, binPath + @"\Plugins\", ".plugin"));
        }
コード例 #8
0
 private ThreadedExecutionStore(IServiceLocatorStore store)
 {
     this.store = store;
     RequestedTypes = new List<Type>();
     index = 0;
     store.SetStore<IResolutionStore>(new ThreadedResolutionStore());
 }
コード例 #9
0
        public DefaultResolutionPipeline(Foundation foundation, IServiceLocatorAdapter adapter, IServiceLocatorStore store)
            : base(foundation, adapter, store)
        {
            var pipeline = new PostResolutionPipeline(foundation, adapter, store);

            Add(new AdapterPipelineItem(foundation, adapter, store, pipeline));
        }
コード例 #10
0
            public object Resolve(IInstanceResolver locator, IServiceLocatorStore context)
            {
                var stores = context.All <IResolutionStore>().ToList();
                var items  = new List <IResolutionArgument>();

                stores.ForEach(x => items.AddRange(x.Items));

                return(locator.GetInstance(type, name, items.OfType <IResolutionArgument, IResolutionArgument>()));
            }
コード例 #11
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var namedRegistration = (INamedRegistration)registration;

            var mappedTo = registration.GetMappedTo();

            adapter.RegisterInstanceWithName(registration.GetMappedToType(), mappedTo, namedRegistration.Key);
            adapter.RegisterInstanceWithName(registration.GetMappedFromType(), mappedTo, namedRegistration.Key);
        }
コード例 #12
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var namedRegistration = (INamedRegistration)registration;

            var mappedTo = registration.GetMappedTo();

            adapter.RegisterInstanceWithName(registration.GetMappedToType(), mappedTo, namedRegistration.Key);
            adapter.RegisterInstanceWithName(registration.GetMappedFromType(), mappedTo, namedRegistration.Key);
        }
コード例 #13
0
ファイル: PerRequest.cs プロジェクト: adamjmoon/Siege
        public override object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            if (!tempData.ContainsKey(registration.GetMappedToType().ToString()))
            {
                tempData[registration.GetMappedToType().ToString()] = registration.ResolveWith(locator, context, pipeline);
            }

            return tempData[registration.GetMappedToType().ToString()];
        }
コード例 #14
0
        public override object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            if (!tempData.ContainsKey(registration.GetMappedToType().ToString()))
            {
                tempData[registration.GetMappedToType().ToString()] = registration.ResolveWith(locator, context, pipeline);
            }

            return(tempData[registration.GetMappedToType().ToString()]);
        }
コード例 #15
0
        public void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            if (registration is ConstructorRegistration)
            {
                var constructorRegistration = registration as ConstructorRegistration;

                store.Get<IInjectionOverrideStore>().Add(constructorRegistration.Arguments);
            }
        }
コード例 #16
0
        public void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            if (registration is ConstructorRegistration)
            {
                var constructorRegistration = registration as ConstructorRegistration;

                store.Get <IInjectionOverrideStore>().Add(constructorRegistration.Arguments);
            }
        }
コード例 #17
0
        public virtual bool IsValid(IActivationRule rule, IInstanceResolver resolver, IServiceLocatorStore context)
        {
            var items = MergeContextItems(context);
            for (int i = 0; i < items.Count; i++)
            {
                var contextItem = items[i];
                if (rule.Evaluate(resolver, contextItem)) return true;
            }

            return false;
        }
コード例 #18
0
        public bool IsValid(IActivationRule rule, IInstanceResolver resolver, IServiceLocatorStore context)
        {
            var types = context.Get<IExecutionStore>().RequestedTypes;
            for(int i = 0; i < types.Count; i++)
            {
                var dependency = types[i];
                if (rule.Evaluate(resolver, dependency)) return true;
            }

            return false;
        }
コード例 #19
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var namedRegistration = (INamedRegistration)registration;

            var mappedToType   = registration.GetMappedToType();
            var mappedFromType = registration.GetMappedFromType();

            adapter.RegisterWithName(mappedToType, mappedToType, namedRegistration.Key);
            adapter.RegisterWithName(mappedFromType, mappedToType, namedRegistration.Key);

            RegisterNamedLazy(adapter, mappedFromType, namedRegistration.Key);
            RegisterNamedLazy(adapter, mappedToType, namedRegistration.Key);
        }
コード例 #20
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var mappedFromType = registration.GetMappedFromType();
            var mappedToType   = registration.GetMappedToType();

            adapter.RegisterFactoryMethod(mappedFromType, () => pipeline.Execute(mappedFromType));
            adapter.RegisterInstance(mappedToType, registration.GetMappedTo());
            RegisterLazy(adapter, mappedFromType, pipeline);
            RegisterLazy(adapter, mappedToType, pipeline);

            RegisterContextual(adapter, mappedFromType);
            RegisterContextual(adapter, mappedToType);
        }
コード例 #21
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var mappedFromType = registration.GetMappedFromType();
            var mappedToType = registration.GetMappedToType();

            adapter.RegisterFactoryMethod(mappedFromType, () => pipeline.Execute(mappedFromType));
            adapter.RegisterInstance(mappedToType, registration.GetMappedTo());
            RegisterLazy(adapter, mappedFromType, pipeline);
            RegisterLazy(adapter, mappedToType, pipeline);

            RegisterContextual(adapter, mappedFromType);
            RegisterContextual(adapter, mappedToType);
        }
コード例 #22
0
        public override void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
        {
            var namedRegistration = (INamedRegistration) registration;

            var mappedToType = registration.GetMappedToType();
            var mappedFromType = registration.GetMappedFromType();

            adapter.RegisterWithName(mappedToType, mappedToType, namedRegistration.Key);
            adapter.RegisterWithName(mappedFromType, mappedToType, namedRegistration.Key);

            RegisterNamedLazy(adapter, mappedFromType, namedRegistration.Key);
            RegisterNamedLazy(adapter, mappedToType, namedRegistration.Key);
        }
コード例 #23
0
ファイル: Registration.cs プロジェクト: cbayles/Siege
        public virtual object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            object instance = null;

            instance = GetActivationStrategy().Resolve(locator, context);

            if (pipeline != null)
            {
                var result = GetResult(instance);

                pipeline.Execute(result);
            }

            return(instance);
        }
コード例 #24
0
ファイル: Singleton.cs プロジェクト: adamjmoon/Siege
        public override object ResolveWith(IInstanceResolver resolver, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            if (instance == null)
            {
                lock (lockObject)
                {
                    if(instance == null)
                    {
                        instance = registration.ResolveWith(resolver, context, pipeline);
                    }
                }
            }

            return instance;
        }
コード例 #25
0
ファイル: Registration.cs プロジェクト: rexwhitten/Siege
        public virtual object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            object instance = null;

            instance = GetActivationStrategy().Resolve(locator, context);

            if(pipeline != null)
            {
                var result = GetResult(instance);

                pipeline.Execute(result);
            }

            return instance;
        }
コード例 #26
0
        public bool IsValid(IActivationRule rule, IInstanceResolver resolver, IServiceLocatorStore context)
        {
            var types = context.Get <IExecutionStore>().RequestedTypes;

            for (int i = 0; i < types.Count; i++)
            {
                var dependency = types[i];
                if (rule.Evaluate(resolver, dependency))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #27
0
        public override object ResolveWith(IInstanceResolver resolver, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            if (instance == null)
            {
                lock (lockObject)
                {
                    if (instance == null)
                    {
                        instance = registration.ResolveWith(resolver, context, pipeline);
                    }
                }
            }

            return(instance);
        }
コード例 #28
0
ファイル: PerHttpRequest.cs プロジェクト: rexwhitten/Siege
        public override object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            var httpContext = locator.GetInstance<HttpContextBase>();
            var instance = httpContext.Items[key];
            if (instance == null)
            {
                lock (lockObject)
                {
                    if (instance == null)
                    {
                        instance = registration.ResolveWith(locator, context, pipeline);
                        httpContext.Items.Add(key, instance);
                        return instance;
                    }
                }
            }

            return httpContext.Items[key];
        }
コード例 #29
0
ファイル: PerHttpRequest.cs プロジェクト: cbayles/Siege
        public override object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline)
        {
            var httpContext = locator.GetInstance <HttpContextBase>();
            var instance    = httpContext.Items[key];

            if (instance == null)
            {
                lock (lockObject)
                {
                    if (instance == null)
                    {
                        instance = registration.ResolveWith(locator, context, pipeline);
                        httpContext.Items.Add(key, instance);
                        return(instance);
                    }
                }
            }

            return(httpContext.Items[key]);
        }
コード例 #30
0
        protected static List<object> MergeContextItems(IServiceLocatorStore context)
        {
            var contextItems = new List<object>();
            var resolutionItems = context.Get<IResolutionStore>().Items;

            for (int i = 0; i < resolutionItems.Count; i++)
            {
                var argument = resolutionItems[i];
                if (argument is ContextArgument) contextItems.Add(((ContextArgument) argument).ContextItem);
            }

            var items = context.Get<IContextStore>().Items;

            for (int i = 0; i < items.Count; i++)
            {
                var item = items[i];
                contextItems.Add(item);
            }

            return contextItems;
        }
コード例 #31
0
ファイル: ServiceLocator.cs プロジェクト: legendz3/Siege
        protected ServiceLocator(IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store)
        {
            this.serviceLocator    = serviceLocator;
            this.store             = store;
            foundation             = new Foundation();
            pipeline               = new DefaultResolutionPipeline(foundation, serviceLocator, this.store);
            factoryPipeline        = new FactoryResolutionPipeline(foundation, serviceLocator, this.store);
            postResolutionPipeline = new PostResolutionPipeline(foundation, serviceLocator, store);

            registrationTemplate = new DefaultMetaRegistrationTemplate(serviceLocator);

            serviceLocator.Register(typeof(Transient), typeof(Transient));
            serviceLocator.Register(typeof(Singleton), typeof(Singleton));
            serviceLocator.RegisterInstance(typeof(IServiceLocatorAdapter), serviceLocator);
            serviceLocator.RegisterInstance(typeof(IServiceLocator), this);
            serviceLocator.RegisterInstance(typeof(Microsoft.Practices.ServiceLocation.IServiceLocator), this);
            serviceLocator.RegisterInstance(typeof(Foundation), this.foundation);
            serviceLocator.RegisterInstance(typeof(IServiceLocatorStore), this.store);
            serviceLocator.RegisterInstance(typeof(IContextStore), this.store.Get <IContextStore>());
            serviceLocator.RegisterInstance(typeof(IExecutionStore), this.store.Get <IExecutionStore>());
            serviceLocator.RegisterInstance(typeof(IResolutionStore), this.store.Get <IResolutionStore>());
        }
コード例 #32
0
        protected static List <object> MergeContextItems(IServiceLocatorStore context)
        {
            var contextItems    = new List <object>();
            var resolutionItems = context.Get <IResolutionStore>().Items;

            for (int i = 0; i < resolutionItems.Count; i++)
            {
                var argument = resolutionItems[i];
                if (argument is ContextArgument)
                {
                    contextItems.Add(((ContextArgument)argument).ContextItem);
                }
            }

            var items = context.Get <IContextStore>().Items;

            for (int i = 0; i < items.Count; i++)
            {
                var item = items[i];
                contextItems.Add(item);
            }

            return(contextItems);
        }
コード例 #33
0
ファイル: FactoryRegistration.cs プロジェクト: legendz3/Siege
 public object Resolve(IInstanceResolver locator, IServiceLocatorStore context)
 {
     return(factoryMethod(locator));
 }
コード例 #34
0
ファイル: Registration.cs プロジェクト: rexwhitten/Siege
 public virtual bool IsValid(IInstanceResolver locator, IServiceLocatorStore context)
 {
     return rule != null && rule.GetRuleEvaluationStrategy().IsValid(rule, locator, context);
 }
コード例 #35
0
 public PostResolutionPipeline(Foundation foundation, IServiceLocatorAdapter adapter, IServiceLocatorStore store)
 {
     Add(new ConditionalPostResolutionPipelineItem(foundation, adapter, store));
     Add(new DefaultPostResolutionPipelineItem(foundation, adapter, store));
 }
コード例 #36
0
 public void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
 {
     adapter.Register(registration.GetMappedFromType(), registration.GetMappedToType());
 }
コード例 #37
0
 public void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
 {
     store.Get <IAwarenessStore>().Add(registration.GetMappedTo());
 }
コード例 #38
0
 public AdapterPipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator,
                            IServiceLocatorStore store, PostResolutionPipeline pipeline)
     : base(foundation, serviceLocator, store)
 {
     this.pipeline = pipeline;
 }
コード例 #39
0
 protected WcfContextExecutionStore(IServiceLocatorStore store)
 {
     this.store = store;
     this.store.SetStore<IResolutionStore>(new WcfResolutionStore());
     WcfOperationContext.Current.Items["WcfContextExecutionStore_ExecutionCount"] = 0;
 }
コード例 #40
0
ファイル: BasePipelineItem.cs プロジェクト: rexwhitten/Siege
 protected BasePipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store)
 {
     this.foundation = foundation;
     this.serviceLocator = serviceLocator;
     this.store = store;
 }
コード例 #41
0
 public void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
 {
 }
コード例 #42
0
 public override object ResolveWith(IInstanceResolver resolver, IServiceLocatorStore context, PostResolutionPipeline pipeline)
 {
     return(action((TService)base.ResolveWith(resolver, context, pipeline)));
 }
コード例 #43
0
ファイル: AdapterPipelineItem.cs プロジェクト: cbayles/Siege
 public AdapterPipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator,
                            IServiceLocatorStore store, PostResolutionPipeline pipeline)
     : base(foundation, serviceLocator, store)
 {
     this.pipeline = pipeline;
 }
コード例 #44
0
 protected HttpContextExecutionStore(IServiceLocatorStore store)
 {
     this.store = store;
     this.store.SetStore<IResolutionStore>(new HttpResolutionStore());
     HttpContext.Current.Items["executionCount"] = 0;
 }
コード例 #45
0
 public abstract void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline);
コード例 #46
0
ファイル: Transient.cs プロジェクト: cbayles/Siege
 public override object ResolveWith(IInstanceResolver resolver, IServiceLocatorStore context, PostResolutionPipeline pipeline)
 {
     return(registration.ResolveWith(resolver, context, pipeline));
 }
コード例 #47
0
 protected HttpServiceLocator(IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store)
     : base(serviceLocator, store)
 {
     serviceLocator.Register(typeof(PerHttpRequest), typeof(PerHttpRequest));
     Register(Given<HttpContextBase>.ConstructWith(x => new HttpContextWrapper(HttpContext.Current)));
 }
コード例 #48
0
 public abstract object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline);
コード例 #49
0
 public void Register(IServiceLocatorAdapter adapter, IServiceLocatorStore store, IRegistration registration, ResolutionPipeline pipeline)
 {
     store.Get<IAwarenessStore>().Add(registration.GetMappedTo());
 }
コード例 #50
0
 public abstract object ResolveWith(IInstanceResolver locator, IServiceLocatorStore context, PostResolutionPipeline pipeline);
コード例 #51
0
 public DefaultPipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store, PostResolutionPipeline pipeline) : base(foundation, serviceLocator, store)
 {
     this.pipeline = pipeline;
     this.store.Get <IExecutionStore>().WireEvent((ITypeRequester)this);
     this.store.Get <IExecutionStore>().WireEvent((ITypeResolver)this);
     this.registrationStore = foundation.StoreFor <DefaultRegistrationStore>();
 }
コード例 #52
0
 public bool IsValid(IInstanceResolver locator, IServiceLocatorStore context)
 {
     return registration.IsValid(locator, context);
 }
コード例 #53
0
 public ConditionalPostResolutionPipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store) : base(foundation, serviceLocator, store)
 {
     registrationStore = foundation.StoreFor <ConditionalPostResolutionStore>();
 }
コード例 #54
0
 public object Resolve(IInstanceResolver locator, IServiceLocatorStore context)
 {
     return(implementation);
 }
コード例 #55
0
 public bool IsValid(IInstanceResolver locator, IServiceLocatorStore context)
 {
     return(registration.IsValid(locator, context));
 }
コード例 #56
0
 protected BasePipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store)
 {
     this.foundation     = foundation;
     this.serviceLocator = serviceLocator;
     this.store          = store;
 }
コード例 #57
0
 public static IExecutionStore New(IServiceLocatorStore store)
 {
     return new ThreadedExecutionStore(store);
 }
コード例 #58
0
 public static IExecutionStore New(IServiceLocatorStore store)
 {
     return new WcfContextExecutionStore(store);
 }
コード例 #59
0
 public object ResolveWith(IInstanceResolver resolver, IServiceLocatorStore context, PostResolutionPipeline pipeline)
 {
     return registration.ResolveWith(resolver, context, pipeline);
 }
コード例 #60
0
        public FactoryResolutionPipeline(Foundation foundation, IServiceLocatorAdapter adapter, IServiceLocatorStore store)
        {
            var pipeline = new PostResolutionPipeline(foundation, adapter, store);

            Add(new ConditionalPipelineItem(foundation, adapter, store, pipeline));
            Add(new DefaultPipelineItem(foundation, adapter, store, pipeline));
        }