Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IxHost"/> class.
        /// This is first build phase. Second phase performed by <see cref="Initialize"/>.
        /// </summary>
        public IxHost()
        {
            _argumentProvider = new IxArgumentProvider(this);

            // TODO: Load priorities from configs.
            InstanceFactoryBuilder.Add(ExistingInstanceRawFactoryBuilder, 100);
            InstanceFactoryBuilder.Add(ClassInstanceFactoryBuilder, 200);
            InstanceFactoryBuilder.Add(DelegateInstanceBuilder, 300);

            VisibilityFilterBuilder.Add(StdVisibilityFilterBuilder, 100);

            ProviderNodeBuilder.Add(StdProviderConfigDefaultsSetter, 100);
            ProviderNodeBuilder.Add(ScopeBuilder, 200);
            ProviderNodeBuilder.Add(SingletonProviderBuilder, 300);
            ProviderNodeBuilder.Add(PerResolveProviderBuilder, 400);

            ScopeBinderBuilder.Add(RegistrationScopeBinderBuilder, 100);

            DisposeHandlerBuilder.Add(DisposableDisposeHandlerBuilder, 100);
            DisposeHandlerBuilder.Add(AsyncDisposableDisposeHandlerBuilder, 200);

            ResolveHandler.Add(SelfResolveInterceptor, 80);
            ResolveHandler.Add(ResolverResolveInterceptor, 100);
            ResolveHandler.Add(DirectCycleResolveInterceptor, 150);
            ResolveHandler.Add(SelfToChildrenResolver, 200);
            ResolveHandler.Add(StdResolveInterceptor, 300);
            ResolveHandler.Add(ResolveContextResolveInterceptor, 400);
        }
Esempio n. 2
0
        ///
        public IxArgumentInstance(IxArgumentProvider providerNode, [CanBeNull] object instanceObj)
        {
            Critical.CheckedAssert(providerNode != null, "Provider node should not be null.");

            Object       = instanceObj;
            ProviderNode = providerNode;
        }