コード例 #1
0
        /// <inheritdoc />
        public ComponentHandle ResolveHandleByComponentId(string componentId)
        {
            if (componentId == null)
            {
                throw new ArgumentNullException("componentId");
            }

            IComponentDescriptor descriptor = ResolveNonDisabledDescriptorByComponentId(componentId);

            return(ComponentHandle.CreateInstance(descriptor));
        }
コード例 #2
0
        /// <inheritdoc />
        public IList <ComponentHandle <TService, TTraits> > ResolveAllHandles <TService, TTraits>() where TTraits : Traits
        {
            var result = new List <ComponentHandle <TService, TTraits> >();

            foreach (IComponentDescriptor descriptor in ResolveAllNonDisabledDescriptors(typeof(TService)))
            {
                result.Add(ComponentHandle.CreateInstance <TService, TTraits>(descriptor));
            }

            return(result);
        }
コード例 #3
0
        /// <inheritdoc />
        public ComponentHandle ResolveHandle(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }

            IComponentDescriptor descriptor = ResolveNonDisabledDescriptor(serviceType);

            return(ComponentHandle.CreateInstance(descriptor));
        }
コード例 #4
0
        /// <inheritdoc />
        public IList <ComponentHandle> ResolveAllHandles(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }

            var result = new List <ComponentHandle>();

            foreach (IComponentDescriptor descriptor in ResolveAllNonDisabledDescriptors(serviceType))
            {
                result.Add(ComponentHandle.CreateInstance(descriptor));
            }

            return(result);
        }
コード例 #5
0
        /// <inheritdoc />
        public ComponentHandle <TService, TTraits> ResolveHandle <TService, TTraits>() where TTraits : Traits
        {
            IComponentDescriptor descriptor = ResolveNonDisabledDescriptor(typeof(TService));

            return(ComponentHandle.CreateInstance <TService, TTraits>(descriptor));
        }