public ContainerServicesBuilder()
 {
     _automaticRegistrationFactory     = new DefaultAutomaticRegistrationFactory();
     _concurrentDictionaryFactory      = new DefaultConcurrentDictionaryFactory();
     _registrationCollectionFactory    = new ReaderWriterLockedListFactory();
     _containerScopeFactory            = new DefaultContainerScopeFactory();
     _defaultInstantiationInfoSelector = new ConstructorWithMostParametersSelector();
     _ignoredAbstractionTypes          = ContainerServices.DefaultIgnoredAbstractionTypes;
     _resolveContextFactory            = new PerThreadResolveContextFactory();
     _resolveDelegateFactory           = ContainerServices.CreateDefaultResolveDelegateFactory();
     _resolveInfoAlgorithm             = new PreferResolveAllOverGenericTypeDefinitionAlgorithm();
     _setupContainer = ContainerServices.DefaultSetupContainer;
 }
        public ContainerServicesBuilder(ContainerServices existingServices)
        {
            existingServices.MustNotBeNull(nameof(existingServices));

            _concurrentDictionaryFactory      = existingServices.ConcurrentDictionaryFactory;
            _registrationCollectionFactory    = existingServices.RegistrationCollectionFactory;
            _containerScopeFactory            = existingServices.ContainerScopeFactory;
            _defaultInstantiationInfoSelector = existingServices.DefaultInstantiationInfoSelector;
            _ignoredAbstractionTypes          = existingServices.IgnoredAbstractionTypes;
            _resolveDelegateFactory           = existingServices.ResolveDelegateFactory;
            _automaticRegistrationFactory     = existingServices.AutomaticRegistrationFactory;
            _resolveContextFactory            = existingServices.ResolveContextFactory;
            _resolveInfoAlgorithm             = existingServices.ResolveInfoAlgorithm;
            _setupContainer = existingServices.SetupContainer;
        }
Ejemplo n.º 3
0
 public ContainerServices(IConcurrentDictionaryFactory concurrentDictionaryFactory,
                          IRegistrationCollectionFactory registrationCollectionFactory,
                          IDefaultInstantiationInfoSelector defaultInstantiationInfoSelector,
                          IReadOnlyList <Type> ignoredAbstractionTypes,
                          IContainerScopeFactory containerScopeFactory,
                          IResolveDelegateFactory resolveDelegateFactory,
                          IAutomaticRegistrationFactory automaticRegistrationFactory,
                          IResolveContextFactory resolveContextFactory,
                          IResolveInfoAlgorithm resolveInfoAlgorithm,
                          Action <DependencyInjectionContainer> setupContainer = null)
 {
     ConcurrentDictionaryFactory      = concurrentDictionaryFactory.MustNotBeNull(nameof(concurrentDictionaryFactory));
     RegistrationCollectionFactory    = registrationCollectionFactory.MustNotBeNull(nameof(registrationCollectionFactory));
     DefaultInstantiationInfoSelector = defaultInstantiationInfoSelector.MustNotBeNull(nameof(defaultInstantiationInfoSelector));
     IgnoredAbstractionTypes          = ignoredAbstractionTypes.MustNotBeNull(nameof(ignoredAbstractionTypes));
     ContainerScopeFactory            = containerScopeFactory.MustNotBeNull(nameof(containerScopeFactory));
     ResolveDelegateFactory           = resolveDelegateFactory.MustNotBeNull(nameof(resolveDelegateFactory));
     AutomaticRegistrationFactory     = automaticRegistrationFactory.MustNotBeNull(nameof(automaticRegistrationFactory));
     ResolveContextFactory            = resolveContextFactory.MustNotBeNull(nameof(resolveContextFactory));
     ResolveInfoAlgorithm             = resolveInfoAlgorithm.MustNotBeNull(nameof(resolveInfoAlgorithm));
     SetupContainer = setupContainer;
 }
 public ContainerServicesBuilder WithResolveDelegateFactory(IResolveDelegateFactory resolveDelegateFactory)
 {
     _resolveDelegateFactory = resolveDelegateFactory;
     return(this);
 }