Ejemplo n.º 1
0
        private CompositeContainer(CompositeRuntimeSettings runtimeSettings = null, IoC.CompositeContainer container = null)
        {
            IRuntime compositeRuntime = null;
            INCopDependencyAwareRegistry    registry         = null;
            INCopDependencyContainerAdapter compositeAdpater = null;

            this.runtimeSettings = runtimeSettings ?? CompositeRuntimeSettings.Empty;
            compositeAdpater     = this.runtimeSettings.DependencyContainerAdapter;

            if (compositeAdpater.IsNotNull())
            {
                dependencyContainer = compositeAdpater;
                registry            = new NCopRegistryAdapter(compositeAdpater);
            }
            else
            {
                var compositeContainerAdapter = new CompositeContainerAdapter(container);

                registry            = compositeContainerAdapter;
                dependencyContainer = compositeContainerAdapter;
            }

            registry         = new CompositeRegistryDecorator(registry);
            compositeRuntime = new CompositeRuntime(this.runtimeSettings, registry);
            compositeRuntime.Run();
        }
Ejemplo n.º 2
0
        public CompositeContainer(CompositeRuntimeSettings runtimeSettings = null)
        {
            INCopRegistry registry         = null;
            IRuntime      compositeRuntime = null;

            runtimeSettings  = runtimeSettings ?? CompositeRuntimeSettings.Empty;
            compositeAdapter = runtimeSettings.DependencyContainerAdapter ?? new CompositeContainerAdapter();
            registry         = new CompositeRegistryDecorator(compositeAdapter);
            compositeRuntime = new CompositeRuntime(runtimeSettings, registry);
            compositeRuntime.Run();
        }