public DiContainer CreateSubContainer(List <TypeValuePair> args, InjectContext context, out Action injectAction)
        {
            var subContainer = _container.CreateSubContainer();

            SubContainerCreatorUtil.ApplyBindSettings(_containerBindInfo, subContainer);

            var extraArgs = ZenPools.SpawnList <TypeValuePair>();

            extraArgs.AllocFreeAddRange(_extraArgs);
            extraArgs.AllocFreeAddRange(args);

            var installer = (InstallerBase)subContainer.InstantiateExplicit(
                _installerType, extraArgs);

            ZenPools.DespawnList(extraArgs);

            installer.InstallBindings();

            injectAction = () =>
            {
                subContainer.ResolveRoots();
            };

            return(subContainer);
        }
예제 #2
0
        protected DiContainer CreateEmptySubContainer()
        {
            var subContainer = _container.CreateSubContainer();

            SubContainerCreatorUtil.ApplyBindSettings(_containerBindInfo, subContainer);
            return(subContainer);
        }
        public DiContainer CreateSubContainer(List <TypeValuePair> args, InjectContext context)
        {
            var subContainer = _container.CreateSubContainer();

            SubContainerCreatorUtil.ApplyBindSettings(_containerBindInfo, subContainer);

            var installer = (InstallerBase)subContainer.InstantiateExplicit(
                _installerType, args.Concat(_extraArgs).ToList());

            installer.InstallBindings();

            subContainer.ResolveRoots();

            return(subContainer);
        }