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
        public static void ImportFiles(fmNexus mainform, string path)
        {
            fmImport fmi = new fmImport(mainform);

            fmi.cbPath.Text = path;

            if (Globals.QuietMode == true)
            {
                fmi.EnumImporters();
            }
            else
            {
                fmi.Show(mainform);
            }



            fmi.DoImport();
            fmi.Close();
        }
Exemple #3
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));
        }
Exemple #4
0
 private fmNexus MainForm;  //Cache an instance of this for logging to the log file and other stuff
 public fmImport(fmNexus mainform)
 {
     InitializeComponent();
     MainForm = mainform;
 }