コード例 #1
0
ファイル: Program.cs プロジェクト: baba-s/MonkeyTestTool
 public CustomApplication() :  base()
 {
     EnableVisualStyles    =  true;
     IsSingleInstance      =  true;
     MainForm              =  new MainForm();
     StartupNextInstance  +=  new StartupNextInstanceEventHandler(OnStartupNext);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: jeffalbano/projects
 public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
 {
     SingleInstanceApplication app = new SingleInstanceApplication();
     app.MainForm = f;
     app.StartupNextInstance += startupHandler;
     app.Run(Environment.GetCommandLineArgs());
 }
コード例 #3
0
 public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
 {
     Form = f;
     var app = new SingleInstanceApplication { MainForm = f };
     app.StartupNextInstance += startupHandler;
     var args = Environment.GetCommandLineArgs();
     app.Run(args);
 }
コード例 #4
0
            public App()
            {
                IsSingleInstance   = Properties.Settings.Default.singleInstance;
                EnableVisualStyles = true;

                ShutdownStyle        = ShutdownMode.AfterMainFormCloses;
                StartupNextInstance += new StartupNextInstanceEventHandler(SIApp_StartupNextInstance);
            }
コード例 #5
0
        public static void Run(Form mainForm, StartupNextInstanceEventHandler handler)
        {
            var starter = new SingleInstanceApplicationStarter();

            starter.MainForm             = mainForm;
            starter.StartupNextInstance += handler;
            starter.Run(Environment.GetCommandLineArgs());
        }
コード例 #6
0
    public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
    {
        SingleInstanceApplication app = new SingleInstanceApplication();

        app.MainForm             = f;
        app.StartupNextInstance += startupHandler;
        app.Run(new string[0]);
    }
コード例 #7
0
        public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
        {
            SingleInstanceApplication app = new SingleInstanceApplication();

            app.MainForm             = f;
            app.StartupNextInstance += startupHandler;
            app.Run(Environment.GetCommandLineArgs());
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: a1tavista/pawnbox
 public static void Run(Form form, StartupNextInstanceEventHandler startupHandler)
 {
     OneInstanceApp app = new OneInstanceApp();
     app.IsSingleInstance = true;
     app.MainForm = form;
     app.StartupNextInstance += startupHandler;
     app.Run(Environment.GetCommandLineArgs());
 }
コード例 #9
0
            public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
            {
                var app = new ProcessInit {
                    MainForm = f
                };

                app.StartupNextInstance += startupHandler;
                app.Run(Environment.GetCommandLineArgs());
            }
コード例 #10
0
        static public void Run(ITunesHandler handler, Form mainForm, string[] commandLine)
        {
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            StartupNextInstanceEventHandler startupNextInstanceEventHandler = new StartupNextInstanceEventHandler(app_StartupNextInstance);
            ShutdownEventHandler shutdownEventHandler = new ShutdownEventHandler(app_Shutdown);

            SingleInstanceApplication.Run(mainForm, commandLine, startupNextInstanceEventHandler, shutdownEventHandler);
        }
コード例 #11
0
 public static void Start(Form f, StartupNextInstanceEventHandler handler)
 {
     if (app == null && f != null)
     {
         app = new SingleInstanceApp(f);
     }
     app.StartupNextInstance += handler;
     app.Run(Environment.GetCommandLineArgs());
 }
コード例 #12
0
        static public void Run(ITunesHandler handler, Form mainForm, string[] commandLine)
        {
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            StartupNextInstanceEventHandler startupNextInstanceEventHandler = new StartupNextInstanceEventHandler(app_StartupNextInstance);
            ShutdownEventHandler            shutdownEventHandler            = new ShutdownEventHandler(app_Shutdown);

            SingleInstanceApplication.Run(mainForm, commandLine, startupNextInstanceEventHandler, shutdownEventHandler);
        }
コード例 #13
0
        // Construct SingleInstanceApp object, and invoke its run method.
        public static void Start(Form f, StartupNextInstanceEventHandler handler)
        {
            if (app == null && f != null)
                app = new SingleInstanceApp(f);

            // Wire up StartupNextInstance event handler.
            app.StartupNextInstance += handler;
            app.Run(Environment.GetCommandLineArgs());
        }
コード例 #14
0
 public static void Run(Form mainForm, string[] commandLine, StartupNextInstanceEventHandler startUpNextInstanceEventHandler, ShutdownEventHandler shutdownEventHandler)
 {
     SingleInstanceApplication app = new SingleInstanceApplication();
     if (startUpNextInstanceEventHandler != null) app.StartupNextInstance += startUpNextInstanceEventHandler;
     if (shutdownEventHandler != null) app.Shutdown += shutdownEventHandler;
     if (mainForm != null) app.MainForm = mainForm;
     app.Run(commandLine);
     app.OnShutdown();
 }
コード例 #15
0
        public static void Run(Form form, StartupNextInstanceEventHandler startupHandler)
        {
            OneInstanceApp oneInstanceApp =
                new OneInstanceApp();

            oneInstanceApp.MainForm             = form;
            oneInstanceApp.StartupNextInstance += startupHandler;
            oneInstanceApp.Run(Environment.GetCommandLineArgs());
        }
コード例 #16
0
 public static void Run(RibbonForm f, StartupNextInstanceEventHandler startupHandler)
 {
     SingleInstanceApplication app = new SingleInstanceApplication();
     app.MainForm= f;
     if (f.DialogResult != DialogResult.Cancel)
     {
         app.StartupNextInstance += startupHandler;
         app.Run(Environment.GetCommandLineArgs());
     }
 }
コード例 #17
0
ファイル: Program.cs プロジェクト: shalien/QuickPrint
            public static void Run(Form form, StartupNextInstanceEventHandler startupHandler)
            {
                form.Hide();
                form.WindowState = FormWindowState.Minimized;
                var app = new SingleInstanceApplication {
                    MainForm = form
                };

                app.StartupNextInstance += startupHandler;
                app.Run(Environment.GetCommandLineArgs());
            }
コード例 #18
0
        public App()
        {
            // Make this a single-instance application
            IsSingleInstance   = true;
            EnableVisualStyles = true;

            // There are some other things available in the VB application model, for
            // instance the shutdown style:
            ShutdownStyle = ShutdownMode.AfterMainFormCloses;

            // Add StartupNextInstance handler
            StartupNextInstance += new StartupNextInstanceEventHandler(SIApp_StartupNextInstance);
        }
コード例 #19
0
ファイル: Program.cs プロジェクト: Jonny007-MKD/Trigger4Win
            public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
            {
                SingleInstanceApplication app = new SingleInstanceApplication();
                app.MainForm = f;
                app.StartupNextInstance += startupHandler;

                Options options = new Options();

                if (!CommandLine.Parser.Default.ParseArguments(Environment.GetCommandLineArgs(), options))
                    Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);

                app.Startup += new StartupEventHandler(((Main)f).Init);

                app.Run(Environment.GetCommandLineArgs());
            }
コード例 #20
0
ファイル: Program.cs プロジェクト: Jonny007-MKD/Trigger4Win
            public static void Run(Form f, StartupNextInstanceEventHandler startupHandler)
            {
                SingleInstanceApplication app = new SingleInstanceApplication();

                app.MainForm             = f;
                app.StartupNextInstance += startupHandler;

                Options options = new Options();

                if (!CommandLine.Parser.Default.ParseArguments(Environment.GetCommandLineArgs(), options))
                {
                    Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);
                }

                app.Startup += new StartupEventHandler(((Main)f).Init);

                app.Run(Environment.GetCommandLineArgs());
            }
コード例 #21
0
        public static void Run(Form mainForm, string[] commandLine, StartupNextInstanceEventHandler startUpNextInstanceEventHandler, ShutdownEventHandler shutdownEventHandler)
        {
            SingleInstanceApplication app = new SingleInstanceApplication();

            if (startUpNextInstanceEventHandler != null)
            {
                app.StartupNextInstance += startUpNextInstanceEventHandler;
            }
            if (shutdownEventHandler != null)
            {
                app.Shutdown += shutdownEventHandler;
            }
            if (mainForm != null)
            {
                app.MainForm = mainForm;
            }
            app.Run(commandLine);
            app.OnShutdown();
        }
コード例 #22
0
        public SingleInstanceController()
        {
            IsSingleInstance = true;

            StartupNextInstance += new StartupNextInstanceEventHandler(SingleInstanceController_StartupNextInstance);
        }