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;
        }
示例#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 WithDefaultInstantiationInfoSelector(IDefaultInstantiationInfoSelector defaultInstantiationInfoSelector)
 {
     _defaultInstantiationInfoSelector = defaultInstantiationInfoSelector;
     return(this);
 }
示例#5
0
 public RegistrationOptions(Type targetType, IReadOnlyList <Type> ignoredAbstractionTypes, IDefaultInstantiationInfoSelector defaultInstantiationInfoSelector) : base(targetType, ignoredAbstractionTypes, defaultInstantiationInfoSelector)
 {
 }
 protected BaseCreateInstanceOptions(Type targetType, IReadOnlyList <Type> ignoredAbstractionTypes, IDefaultInstantiationInfoSelector defaultInstantiationInfoSelector) : base(targetType, ignoredAbstractionTypes)
 {
     DefaultInstantiationInfoSelector = defaultInstantiationInfoSelector.MustNotBeNull(nameof(defaultInstantiationInfoSelector));
 }