Catel.IoC.ServiceLocatorAutoRegistrationManager.ServiceLocatorAutoRegistrationManager C# (CSharp) Method

ServiceLocatorAutoRegistrationManager() public method

Initializes a new instance of the ServiceLocatorAutoRegistrationManager class.
The is null.
public ServiceLocatorAutoRegistrationManager ( IServiceLocator serviceLocator ) : System
serviceLocator IServiceLocator The service locator.
return System
        public ServiceLocatorAutoRegistrationManager(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull("serviceLocator", serviceLocator);

            _serviceLocator = serviceLocator;

            if (EnvironmentHelper.IsProcessCurrentlyHostedByTool())
            {
                return;
            }

            TypeCache.AssemblyLoaded += (sender, args) =>
            {
                foreach (var type in args.LoadedTypes)
                {
                    _pendingTypes.Enqueue(type);
                }

                if (_autoRegisterTypesViaAttributes)
                {
                    try
                    {
                        InspectLoadedAssemblies();
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex, "Failed to handle dynamically loaded assembly '{0}'", args.Assembly.FullName);
                    }
                }
            };
        }
        #endregion