public CustomApplication() : base() { EnableVisualStyles = true; IsSingleInstance = true; MainForm = new MainForm(); StartupNextInstance += new StartupNextInstanceEventHandler(OnStartupNext); }
public static void Run(Form f, StartupNextInstanceEventHandler startupHandler) { SingleInstanceApplication app = new SingleInstanceApplication(); app.MainForm = f; app.StartupNextInstance += startupHandler; app.Run(Environment.GetCommandLineArgs()); }
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); }
public App() { IsSingleInstance = Properties.Settings.Default.singleInstance; EnableVisualStyles = true; ShutdownStyle = ShutdownMode.AfterMainFormCloses; StartupNextInstance += new StartupNextInstanceEventHandler(SIApp_StartupNextInstance); }
public static void Run(Form mainForm, StartupNextInstanceEventHandler handler) { var starter = new SingleInstanceApplicationStarter(); starter.MainForm = mainForm; starter.StartupNextInstance += handler; starter.Run(Environment.GetCommandLineArgs()); }
public static void Run(Form f, StartupNextInstanceEventHandler startupHandler) { SingleInstanceApplication app = new SingleInstanceApplication(); app.MainForm = f; app.StartupNextInstance += startupHandler; app.Run(new string[0]); }
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()); }
public static void Run(Form f, StartupNextInstanceEventHandler startupHandler) { var app = new ProcessInit { MainForm = f }; app.StartupNextInstance += startupHandler; app.Run(Environment.GetCommandLineArgs()); }
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); }
public static void Start(Form f, StartupNextInstanceEventHandler handler) { if (app == null && f != null) { app = new SingleInstanceApp(f); } app.StartupNextInstance += handler; app.Run(Environment.GetCommandLineArgs()); }
// 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()); }
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(); }
public static void Run(Form form, StartupNextInstanceEventHandler startupHandler) { OneInstanceApp oneInstanceApp = new OneInstanceApp(); oneInstanceApp.MainForm = form; oneInstanceApp.StartupNextInstance += startupHandler; oneInstanceApp.Run(Environment.GetCommandLineArgs()); }
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()); } }
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()); }
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); }
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()); }
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()); }
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(); }
public SingleInstanceController() { IsSingleInstance = true; StartupNextInstance += new StartupNextInstanceEventHandler(SingleInstanceController_StartupNextInstance); }