Exemple #1
0
        public Wacs(ILifetimeScope container)
        {
            // Basic services
            _container        = container;
            _scopeBuilder     = container.Resolve <IAutofacBuilder>();
            _exceptionHandler = container.Resolve <ExceptionHandler>();
            _log             = _container.Resolve <ILogService>();
            _settings        = _container.Resolve <ISettingsService>();
            _userRoleService = _container.Resolve <UserRoleService>();
            _settings        = _container.Resolve <ISettingsService>();

            try
            {
                Console.OutputEncoding = System.Text.Encoding.GetEncoding(_settings.UI.TextEncoding);
            }
            catch
            {
                _log.Warning("Error setting text encoding to {name}", _settings.UI.TextEncoding);
            }

            ShowBanner();

            _arguments = _container.Resolve <IArgumentsService>();
            _args      = _arguments.MainArguments;
            if (_args == null)
            {
                Environment.Exit(1);
            }

            if (_args.Verbose)
            {
                _log.SetVerbose();
                _arguments.ShowCommandLine();
            }
            _input        = _container.Resolve <IInputService>();
            _renewalStore = _container.Resolve <IRenewalStore>();

            var renewalExecutor = container.Resolve <RenewalExecutor>(
                new TypedParameter(typeof(IContainer), _container));

            _renewalManager = container.Resolve <RenewalManager>(
                new TypedParameter(typeof(IContainer), _container),
                new TypedParameter(typeof(RenewalExecutor), renewalExecutor));
        }
Exemple #2
0
 public RenewalManager(
     IArgumentsService arguments, MainArguments args,
     IRenewalStore renewalStore, IContainer container,
     IInputService input, ILogService log,
     ISettingsService settings,
     IAutofacBuilder autofacBuilder, ExceptionHandler exceptionHandler,
     RenewalExecutor renewalExecutor)
 {
     _renewalStore     = renewalStore;
     _args             = args;
     _input            = input;
     _log              = log;
     _settings         = settings;
     _arguments        = arguments;
     _container        = container;
     _scopeBuilder     = autofacBuilder;
     _exceptionHandler = exceptionHandler;
     _renewalExecutor  = renewalExecutor;
 }
Exemple #3
0
 public RenewalExecutor(
     MainArguments args,
     IAutofacBuilder scopeBuilder,
     ILogService log,
     IInputService input,
     ISettingsService settings,
     RenewalValidator validator,
     ExceptionHandler exceptionHandler,
     IContainer container)
 {
     _validator        = validator;
     _args             = args;
     _scopeBuilder     = scopeBuilder;
     _log              = log;
     _input            = input;
     _settings         = settings;
     _exceptionHandler = exceptionHandler;
     _container        = container;
 }
 public RenewalCreator(
     PasswordGenerator passwordGenerator, MainArguments args,
     IRenewalStore renewalStore, IContainer container,
     IInputService input, ILogService log,
     ISettingsService settings, IAutofacBuilder autofacBuilder,
     NotificationService notification,
     ExceptionHandler exceptionHandler, RenewalExecutor renewalExecutor)
 {
     _passwordGenerator = passwordGenerator;
     _renewalStore      = renewalStore;
     _args             = args;
     _input            = input;
     _log              = log;
     _settings         = settings;
     _container        = container;
     _scopeBuilder     = autofacBuilder;
     _exceptionHandler = exceptionHandler;
     _renewalExecution = renewalExecutor;
     _notification     = notification;
 }