Inheritance: PrinterBase
Exemplo n.º 1
0
        private void ParseCommandLineArguments()
        {
            string commandLine = CommandLineNoExecutableName();
            var    parseResult = _parser.Parse <CommandLineOptions>(commandLine);

            if (!parseResult.Success)
            {
                Bail(parseResult.Error);
            }
            _options = parseResult.Value;

            if (!String.IsNullOrEmpty(_options.OutputFileName))
            {
                try
                {
                    var filePrinter = new FilePrinter(_options.OutputFileName);
                    _context.Printer = filePrinter;
                }
                catch (IOException ex)
                {
                    Bail("Error creating output file: {0}", ex.Message);
                }
            }
        }
Exemplo n.º 2
0
        private void ParseCommandLineArguments()
        {
            string commandLine = CommandLineNoExecutableName();
            var parseResult = _parser.Parse<CommandLineOptions>(commandLine);
            if (!parseResult.Success)
            {
                Bail(parseResult.Error);
            }
            _options = parseResult.Value;

            if (!String.IsNullOrEmpty(_options.OutputFileName))
            {
                try
                {
                    var filePrinter = new FilePrinter(_options.OutputFileName);
                    _context.Printer = filePrinter;
                }
                catch (IOException ex)
                {
                    Bail("Error creating output file: {0}", ex.Message);
                }
            }
        }