Пример #1
0
 public DependencyContainerBuilder(HostUnityContainer unityContainer)
 {
     //    this.InitializeServiceLocator(unityContainer);
     this.UnityContainer       = unityContainer;
     this.TypeRegistrarService = new TypeRegistrarService(this.UnityContainer);
     //  var scopeHostUnityContainer = new HostUnityContainer();
 }
Пример #2
0
        private void InitializeServiceLocator(IHostUnityContainer hostUnityContainer)
        {
            if (isServiceLocatorInitialized)
            {
                return;
            }

            ((IServiceLocatorInitializer)ServiceLocator.Instance).Initialize(hostUnityContainer);
            isServiceLocatorInitialized = true;
        }
Пример #3
0
        void IServiceLocatorInitializer.Initialize(IHostUnityContainer hostUnityContainer)
        {
            if (hostUnityContainer == null)
            {
                throw new ArgumentNullException("hostUnityContainer");
            }

            if (this.hostContainerInternal != null)
            {
                throw new Exception("ServiceLocator is already initialized");
            }

            this.hostContainerInternal = hostUnityContainer;
        }