Exemplo n.º 1
0
        public void Configure(string[] args, ICommandLineArgumentParseService commandLineArgumentParseService, ICommandLineArgumentValidationService commandLineArgumentValidationService)
        {
            _commandLineArgumentParseService      = commandLineArgumentParseService;
            _commandLineArgumentValidationService = commandLineArgumentValidationService;

            var commandLineArguments = BuildCommandLineArguments(args);

            if (!_commandLineArgumentValidationService.IsValid(commandLineArguments))
            {
                throw new Exception(_commandLineArgumentValidationService.Errors[0].Description);
            }

            ICLIService cliService = new CLIService(commandLineArguments);

            cliService.CLILogMessageProcessStatusChanged += Program.CLILogMessageHandler;
            cliService.Generate();
            cliService.CLILogMessageProcessStatusChanged -= Program.CLILogMessageHandler;
        }