Exemplo n.º 1
0
        static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();
            if (!mySingleInstanceMutex.WaitOne(0, false))
            {
                if (DialogResult.Yes != MessageBox.Show("Running MeGUI instance detected!\n\rThere's not really much point in running multiple copies of MeGUI, and it can cause problems.\n\rDo You still want to run yet another MeGUI instance?", "Running MeGUI instance detected", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                {
                    return;
                }
            }
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            CommandlineParser parser = new CommandlineParser();

            parser.Parse(args);
            MeGUIInfo info     = new MeGUIInfo();
            MainForm  mainForm = new MainForm();

            mainForm.AttachInfo(info);
            info.handleCommandline(parser);
            if (parser.start)
            {
                Application.Run(mainForm);
            }
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     System.Windows.Forms.Application.EnableVisualStyles();
     if (!mySingleInstanceMutex.WaitOne(0, false))
     {
         if (DialogResult.Yes != MessageBox.Show("Running MeGUI instance detected!\n\rThere's not really much point in running multiple copies of MeGUI, and it can cause problems.\n\rDo You still want to run yet another MeGUI instance?", "Running MeGUI instance detected", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
             return;
     }
     Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
     Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
     CommandlineParser parser = new CommandlineParser();
     parser.Parse(args);
     MeGUIInfo info = new MeGUIInfo();
     MainForm mainForm = new MainForm();
     mainForm.AttachInfo(info);
     info.handleCommandline(parser);
     if (parser.start)
         Application.Run(mainForm);
 }