private static void StartNewInstance(object sender, StartupNextInstanceEventArgs e) { if (e.CommandLine.Count > 1) { String cmdArg = e.CommandLine[1]; form.AddNewTrack(cmdArg); } }
// Token: 0x06000555 RID: 1365 RVA: 0x000211C6 File Offset: 0x0001F3C6 private static void OnAppStartupNextInstance(object sender, StartupNextInstanceEventArgs e) { if (Program.mainForm.WindowState == FormWindowState.Minimized) { Program.mainForm.WindowState = FormWindowState.Normal; } Program.mainForm.Activate(); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { if (this.myApp != null) { this.myApp.HighlightMainForm(); } // base.OnStartupNextInstance(eventArgs); }
void MainFormStartupNextInstance(object sender, StartupNextInstanceEventArgs e) { var form = MainForm as MainForm; form.Show(); form.TopMost = true; form.TopMost = false; }
public void Ctor_ReadOnlyCollection_Boolean(bool bringToForeground) { var collection = new ReadOnlyCollection <string>(new string[] { "a" }); var args = new StartupNextInstanceEventArgs(collection, bringToForeground); Assert.Same(collection, args.CommandLine); Assert.Equal(bringToForeground, args.BringToForeground); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { // Subsequent launches base.OnStartupNextInstance(eventArgs); App app = Application.Current as App; app.Activate(eventArgs.CommandLine); }
private void OnStartupNextInstance(object sender, StartupNextInstanceEventArgs e) { // Catch with args and forward a message with them if (e.Args.Length > 0) { this.CatchAndForwardArgs(e.Args); } }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { if (this.MainForm.WindowState == FormWindowState.Minimized) { this.MainForm.WindowState = FormWindowState.Normal; } this.MainForm.Activate(); }
void Program_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { e.BringToForeground = true; MainForm form = MainForm as MainForm; form.OpenedFiles = e.CommandLine.ToList(); form.OpenFiles(); }
void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { if (onStartNextInstance != null) { onStartNextInstance(this.MainForm); // This code will be executed when the user tries to start the running program again, // for example, by clicking on the exe file. } // This code can determine how to re-activate the existing main window of the running application. }
protected override async void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { // The official Microsoft example puts the base call line first, so I guess I will too? // https://github.com/microsoft/wpf-samples/tree/main/Application%20Management/SingleInstanceDetection base.OnStartupNextInstance(eventArgs); Core.ActivateMainView(); await Core.HandleCommandLineArgs(eventArgs.CommandLine); }
public static void NewInstanceHandler(object sender, StartupNextInstanceEventArgs e) { string imageLocation = e.CommandLine[1]; MessageBox.Show(imageLocation); e.BringToForeground = false; ControlPanel.uploadImage(imageLocation); }
public void MyApplication_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { //ここに二重起動されたときの処理を書く //e.CommandLineでコマンドライン引数を取得出来る Form1 f = (Form1)this.MainForm; f.GetCommand(e.CommandLine.ToArray <string>()); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { fMain f = (fMain)this.MainForm; string[] args = new string[eventArgs.CommandLine.Count]; eventArgs.CommandLine.CopyTo(args, 0); f.ProcessCommandArgs(args); }
private void ApplicationController_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { e.BringToForeground = true; _mainForm.ShowInTaskbar = true; _mainForm.WindowState = FormWindowState.Minimized; _mainForm.Show(); _mainForm.WindowState = FormWindowState.Normal; }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e) { //Give focus to the main instance e.BringToForeground = true; base.OnStartupNextInstance(e); application.NextInstance(e.CommandLine); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { if (this.MainForm.WindowState == FormWindowState.Minimized) { this.MainForm.Show(); // Unhide if hidden this.MainForm.WindowState = FormWindowState.Normal; //Restore } this.MainForm.Activate(); }
void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { e.BringToForeground = true; Smash_Forge.MainForm form = MainForm as Smash_Forge.MainForm; foreach (string arg in e.CommandLine) { Smash_Forge.MainForm.Instance.openFile(arg); } }
void this_StartupNextInstance(Object sender, StartupNextInstanceEventArgs e) { // Here you get the control when any other instance is // invoked apart from the first one. // You have args here in e.CommandLine. // You custom code which should be run on other instances this.MainForm.Show(); }
/// <summary> /// If another instance is created, shutdown it and active the single instance /// </summary> /// <param name="eventArgs"></param> protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { // Subsequent launches base.OnStartupNextInstance(eventArgs); // Restore and activate the main window System.Windows.SystemCommands.RestoreWindow(wpfApp.MainWindow); wpfApp.MainWindow.Activate(); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { if (HandleCommandLine(eventArgs.CommandLine)) { return; } eventArgs.BringToForeground = true; }
void SingleInstanceController_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { RemoteDesktopClient rdc = (RemoteDesktopClient)this.MainForm; string[] args = new string[e.CommandLine.Count]; e.CommandLine.CopyTo(args, 0); rdc.DoArguments(args); }
private void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { if (e.CommandLine.Count >= 1) { ((MainForm)MainForm).LoadRom(e.CommandLine[0], new MainForm.LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom() }); } }
async void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { if (e.CommandLine.Count > 1) { var main = MainForm as Main; await main.SyncANewUserGroupAsync(e.CommandLine[1], e.CommandLine[2], e.CommandLine[3]); } }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { /* if some files opened from the Explorer, open them */ if (eventArgs.CommandLine.Count > 0) { MainForm = FormController.Instance.OpenFiles(eventArgs.CommandLine); } base.OnStartupNextInstance(eventArgs); }
void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { //Here we bring application to front e.BringToForeground = true; mainForm.ShowInTaskbar = true; mainForm.WindowState = FormWindowState.Minimized; mainForm.Show(); mainForm.WindowState = FormWindowState.Normal; }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e) { if (e.CommandLine.Count > 0) { app.ProcessCommandLine(e.CommandLine.ToArray()); } app.Activate(); }
void SingleInstanceController_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { if (MainForm.WindowState == FormWindowState.Minimized) { (MainForm as MainForm).ShowFromTaskBar(); } MainForm.Activate(); }
private void OnStartupNextInstance(object sender, StartupNextInstanceEventArgs e) { // For some reason OnStartupNextInstance gets called with the wrong context, so have to re-apply locale if (Program.UICulture != null) { CultureInfo.CurrentUICulture = Program.UICulture; } ShowConfigDialog(); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e) { // 这里可以把本次使用的参数传给之前的实例,本人在一个WPF 屏幕键盘项目里传送了键盘显示方式(数字、英文、手写)参数 //e.BringToForeground = true; //if (e.CommandLine.Count > 0) //{ // app.DealArgs(e.CommandLine.ToArray()); //} }
/// <summary> /// Raises the StartupNextInstance event. /// </summary> /// <param name="e">The arguments that describe this event.</param> protected virtual void OnStartupNextInstance(StartupNextInstanceEventArgs e) { if (StartupNextInstance != null) { StartupNextInstance(this, e); } }
// Methods public virtual System.IAsyncResult BeginInvoke(object sender, StartupNextInstanceEventArgs e, System.AsyncCallback DelegateCallback, object DelegateAsyncState) { }
public virtual void Invoke(object sender, StartupNextInstanceEventArgs e) { }
static void StartupNextInstanceHandler(object sender, StartupNextInstanceEventArgs e) { // do whatever you want here with e.CommandLine... e.BringToForeground = true; }