コード例 #1
0
ファイル: MeGUIInfo.cs プロジェクト: paulyc/megui
        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);
            }
        }
コード例 #2
0
ファイル: MeGUIInfo.cs プロジェクト: RoDaniel/featurehouse
 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);
 }