Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var calculatorOptions = CommandLineClient.GetOptions(args);

            try
            {
                var expressionResult = InfixNotationCalculator.Calculate(calculatorOptions.ArithmeticExpression);

                Console.WriteLine(expressionResult);
            }
            catch (Exception exception)
            {
                var errorMessage = string.Concat("Exception was thrown:",
                                                 Environment.NewLine,
                                                 char.ToUpper(exception.Message[0]),
                                                 exception.Message.Substring(1));

                Console.WriteLine(errorMessage);
            }
        }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            try
            {
                var generatorOptions  = CommandLineClient.GetOptions(args);
                var generatorsManager = new GeneratorsManager(generatorOptions);

                var generatorType = generatorOptions.OutputCsvFilepath is null
                                        ? GeneratorType.Console
                                        : GeneratorType.Csv;

                generatorsManager.Generate(generatorType);
            }
            catch (Exception exception)
            {
                var errorMessage = string.Concat("Exception was thrown.",
                                                 Environment.NewLine,
                                                 exception.GetType().FullName + ": ",
                                                 exception.Message);

                Console.WriteLine(errorMessage);
            }
        }