/// <summary> /// Broadcasts the NextInstance event. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">Event arguments.</param> private void OnNextInstance(object sender, NextInstanceEventArgs e) { if (NextInstance != null) { NextInstance(sender, e); } }
/// <summary> /// Triggered when a second instance of Eraser is started. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">Event argument.</param> private static void OnGUINextInstance(object sender, NextInstanceEventArgs e) { //Another instance of the GUI Program has been started: show the main window //now as we still do not have a facility to handle the command line arguments. GuiProgram program = (GuiProgram)sender; //Invoke the function if we aren't on the main thread if (program.MainForm.InvokeRequired) { program.MainForm.Invoke( (GuiProgram.NextInstanceEventHandler)OnGUINextInstance, sender, e); return; } program.MainForm.Show(); }
private static void OnGUINextInstance(object sender, NextInstanceEventArgs e) { GuiProgram program = (GuiProgram)sender; if (program.MainForm.InvokeRequired) { program.MainForm.Invoke( (GuiProgram.NextInstanceEventHandler)OnGUINextInstance, sender, e); return; } program.MainForm.Show(); }
private void OnNextInstance(object sender, NextInstanceEventArgs e) { if (NextInstance != null) NextInstance(sender, e); }