public static CreateServiceLocator ( bool initializeServiceLocator = true ) : IServiceLocator | ||
initializeServiceLocator | bool | if set to |
Résultat | IServiceLocator |
/// <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>(); } }