Esempio n. 1
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            var options = new Options();

            if (args.Any())
            {
                Parser.Default.ParseArgumentsStrict(args, options,
                                                    () =>
                                                    Console.WriteLine("Bad command line parameters."));
            }

            if (Environment.UserInteractive || options.IsConsole)
            {
                var service = new AggregatorService(options);
                service.StartConsole();
            }
            else
            {
                ServiceBase.Run(new AggregatorService(options));
            }
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

             var options = new Options();

            if (args.Any())
            {
               CommandLine.Parser.Default.ParseArgumentsStrict(args, options,
                                                                () =>
                                                                Console.WriteLine("Bad command line parameters."));
            }

            if (Environment.UserInteractive || options.IsConsole)
            {
                var service = new AggregatorService(options.OnlyUsers);
                service.StartConsole();
            }
            else
            {
                ServiceBase.Run(new AggregatorService(options.OnlyUsers));
            }
        }