Exemple #1
0
        static int Main(string[] args)
        {
            //UnhandledExceptionHandler eh = new UnhandledExceptionHandler();

            //Application.ThreadException += new ThreadExceptionEventHandler(eh.OnThreadException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DependencyManager.CheckReportViewer();
            fmNexus fmN = new fmNexus();

            if (0 != args.Length)
            {
                Globals.ConsoleMode = true;
                if (!ProcessCmdLine(args, fmN))
                {
                    return((int)ProgramExitCodes.UserCancel);
                }
            }
            else
            {
                FreeConsole();
            }
            Application.Run(fmN);
            //return (int)(Globals.ExceptionEncountered ? ProgramExitCodes.Exception : ProgramExitCodes.Normal);
            return((int)(Globals.IsNexusCoreImporterSuccessful ? ProgramExitCodes.Normal : ProgramExitCodes.Exception));
        }
Exemple #2
0
        static int Main(string[] args)
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                DependencyManager.CheckReportViewer();

                //initialize the main form
                fmNexus fmN = new fmNexus();



                if (0 != args.Length)
                {
                    Globals.ConsoleMode = true;
                    if (!ProcessCmdLine(args, fmN))
                    {
                        return((int)ProgramExitCodes.UserCancel);
                    }
                }
                else
                {
                    FreeConsole();
                }
                Application.Run(fmN);
            }

            catch (Exception ex)
            {
                Console.WriteLine(string.Format("Exception encountered in Main(): [{0}]", ex.Message));
                Console.WriteLine(string.Format("{0}", ex.StackTrace));
            }

            return((int)(Globals.IsNexusCoreImporterSuccessful ? ProgramExitCodes.Normal : ProgramExitCodes.Exception));
        }