CreateServiceLocator() публичный статический Метод

Creates a service locator with all the customized components.
public static CreateServiceLocator ( bool initializeServiceLocator = true ) : IServiceLocator
initializeServiceLocator bool if set to true, the will be initialized using the interface.
Результат IServiceLocator
Пример #1
0
        /// <summary>
        /// Updates the default components.
        /// <para />
        /// This method should be called when any of the factory methods has been changed.
        /// </summary>
        /// <exception cref="System.Exception">The method fails to create the <see cref="IServiceLocator"/> using the factory.</exception>
        public static void UpdateDefaultComponents()
        {
            Log.Info("Updating default components");

            // Don't initialize the first service locator (we are still loading assemblies at that time)
            bool initializeServiceLocator = (_defaultServiceLocator != null);
            var  serviceLocator           = IoCFactory.CreateServiceLocator(initializeServiceLocator);

            lock (_lockObject)
            {
                DefaultServiceLocator     = serviceLocator;
                DefaultDependencyResolver = serviceLocator.ResolveType <IDependencyResolver>();
                DefaultTypeFactory        = serviceLocator.ResolveType <ITypeFactory>();
            }
        }