상속: PrinterBase
예제 #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);
                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: goldshtn/msos
        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);
                }
            }
        }