コード例 #1
0
        public void Register(ServiceLocation.IServiceLocationRuntimeManager manager, ServiceLocation.IServiceLocator locator)
        {
            if (ReferenceEquals(manager, null))
            {
                throw new ArgumentNullException("manager");
            }
            if (ReferenceEquals(locator, null))
            {
                throw new ArgumentNullException("locator");
            }

            var runtimeManager = new ServiceLocationRuntimeManager();

            manager.RegisterInstance <IServiceLocationRuntimeManager>(runtimeManager);
            manager.RegisterType <IServiceLocationSimulationManager, ServiceLocationSimulationManager>();
            manager.RegisterType <IServiceLocationIndividualTestManager, ServiceLocationIndividualTestManager>();
            manager.RegisterInstance(ServiceLocator.Instance);
            var sweeper = locator.Locate <IServiceLocationAssemblySweep>();

            sweeper.RegisterRegistrarProxy <IServiceLocationRegistrar>(new InternalServiceLocationRegistrarProxyFactory(runtimeManager, ServiceLocator.Instance));
        }
コード例 #2
0
 public void Register(ServiceLocation.IServiceLocationRuntimeManager manager, ServiceLocation.IServiceLocator locator)
 {
     this.registrar.Register(this.manager, this.locator);
 }