public SubContainerCreatorByInstaller(
            DiContainer container,
            SubContainerCreatorBindInfo containerBindInfo,
            Type installerType,
            IEnumerable <TypeValuePair> extraArgs)
        {
            _installerType     = installerType;
            _container         = container;
            _extraArgs         = extraArgs.ToList();
            _containerBindInfo = containerBindInfo;

            Assert.That(installerType.DerivesFrom <InstallerBase>(),
                        "Invalid installer type given during bind command.  Expected type '{0}' to derive from 'Installer<>'", installerType);
        }
Example #2
0
        public ScopeConcreteIdArgConditionCopyNonLazyBinder ByInstaller(Type installerType)
        {
            Assert.That(installerType.DerivesFrom <InstallerBase>(),
                        "Invalid installer type given during bind command.  Expected type '{0}' to derive from 'Installer<>'", installerType);

            var subcontainerBindInfo = new SubContainerCreatorBindInfo();

            ProviderFunc =
                (container) => new SubContainerDependencyProvider(
                    ContractType, SubIdentifier,
                    new SubContainerCreatorByInstaller(
                        container, subcontainerBindInfo, installerType, BindInfo.Arguments), false);

            return(new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo));
        }
Example #3
0
        public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(
#if !NET_4_6 && !NET_STANDARD_2_0
            Assert.Util.
#endif
            Action <DiContainer, TParam1, TParam2, TParam3, TParam4> installerMethod)
        {
            var subcontainerBindInfo = new SubContainerCreatorBindInfo();

            ProviderFunc =
                (container) => new SubContainerDependencyProvider(
                    ContractType, SubIdentifier,
                    new SubContainerCreatorByMethod <TParam1, TParam2, TParam3, TParam4>(
                        container, subcontainerBindInfo, installerMethod), false);

            return(new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo));
        }
Example #4
0
        ByMethod(Action <DiContainer> installerMethod)
        {
            var subContainerBindInfo = new SubContainerCreatorBindInfo();

            SubFinalizer = new SubContainerBindingFinalizer(
                _bindInfo, _subIdentifier, _resolveAll,
                (container) => new SubContainerCreatorByMethod(container, subContainerBindInfo, installerMethod));

            return(new
#if NOT_UNITY3D
                   WithKernelScopeConcreteIdArgConditionCopyNonLazyBinder
#else
                   WithKernelDefaultParentScopeConcreteIdArgConditionCopyNonLazyBinder
#endif
                       (subContainerBindInfo, _bindInfo));
        }
Example #5
0
        ByInstaller(Type installerType)
        {
            Assert.That(installerType.DerivesFrom <InstallerBase>(),
                        "Invalid installer type given during bind command.  Expected type '{0}' to derive from 'Installer<>'", installerType);

            var subContainerBindInfo = new SubContainerCreatorBindInfo();

            SubFinalizer = new SubContainerBindingFinalizer(
                _bindInfo, _subIdentifier, _resolveAll,
                (container) => new SubContainerCreatorByInstaller(container, subContainerBindInfo, installerType));

            return(new
#if NOT_UNITY3D
                   WithKernelScopeConcreteIdArgConditionCopyNonLazyBinder
#else
                   WithKernelDefaultParentScopeConcreteIdArgConditionCopyNonLazyBinder
#endif
                       (subContainerBindInfo, _bindInfo));
        }
Example #6
0
 public SubContainerCreatorByMethodBase(
     DiContainer container, SubContainerCreatorBindInfo containerBindInfo)
 {
     _container         = container;
     _containerBindInfo = containerBindInfo;
 }