Ejemplo n.º 1
0
        private static int Main(string[] args)
        {
            string log4NetFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                              "loggingSettings.xml");
            XmlConfigurator.Configure(new FileInfo(log4NetFile));
            var programParams = new ProgramParams();
            var parser = new CommandLineParser(programParams);
            parser.Parse();

            if (programParams.Help)
            {
                Console.WriteLine(parser.UsageInfo.ToString(78, false));
            }
            else if (parser.HasErrors)
            {
                Console.WriteLine(parser.UsageInfo.ToString(78, true));
                return -1;
            }

            try
            {
                new Program(programParams);
            }
            catch (Exception e)
            {
                log.Error(e.Message, e);
                Console.Out.WriteLine("ERROR: " + e.Message);
                return -1;
            }
            return 0;
        }
Ejemplo n.º 2
0
 private Program(ProgramParams appParams)
 {
     AppParam = appParams;
     Initialize();
 }