ExecuteJob() 공개 메소드

Performs our main 'lifecycle'
public ExecuteJob ( ) : bool
리턴 bool
예제 #1
0
        /// <summary>
        /// Our main entry point for the command line app
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static int Main(string[] args)
        {
            Init();
            LoadConfigFile();
            ShowWelcomeScreen();
            ShowCopyrightAndLicense();


            ImportJob job = new ImportJob();

            if ((args != null) && (args.Length > 0))
            {
                _log.Debug("Loading arguments...");
                if (!job.Load(args))
                {
                    _log.Debug("Error while loading arguments. Exiting.");
                    return(-1);
                }

                if (!job.ExecuteJob())
                {
                    _log.Fatal("An error was encountered while performing the operation.  Please examine the log output and try again if necessary.");
                }
            }
            else
            {
                DisplayOptions();
            }

            //#if DEBUG
            //            _log.Debug("Done! Press ANY KEY to Quit");
            //            Console.ReadKey();
            //#endif
            return(0);
        }
예제 #2
0
        /// <summary>
        /// Our main entry point for the command line app
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static int Main(string[] args)
        {
            Init();
            LoadConfigFile();
            ShowWelcomeScreen();
            ShowCopyrightAndLicense();

            ImportJob job = new ImportJob();
            if ((args != null) && (args.Length > 0))
            {
                _log.Debug("Loading arguments...");
                if (!job.Load(args))
                {
                    _log.Debug("Error while loading arguments. Exiting.");
                    return -1;
                }

                if (!job.ExecuteJob())
                {
                    _log.Fatal("An error was encountered while performing the operation.  Please examine the log output and try again if necessary.");
                }
            }
            else
            {
                DisplayOptions();
            }

            //#if DEBUG
            //            _log.Debug("Done! Press ANY KEY to Quit");
            //            Console.ReadKey();
            //#endif
            return 0;
        }