コード例 #1
0
ファイル: Program.cs プロジェクト: hunghdvn/H2D.AudioPlayer
 private static void StartNewInstance(object sender, StartupNextInstanceEventArgs e)
 {
     if (e.CommandLine.Count > 1)
     {
         String cmdArg = e.CommandLine[1];
         form.AddNewTrack(cmdArg);
     }
 }
コード例 #2
0
 // 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();
 }
コード例 #3
0
 protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
 {
     if (this.myApp != null)
     {
         this.myApp.HighlightMainForm();
     }
     // base.OnStartupNextInstance(eventArgs);
 }
コード例 #4
0
            void MainFormStartupNextInstance(object sender, StartupNextInstanceEventArgs e)
            {
                var form = MainForm as MainForm;

                form.Show();
                form.TopMost = true;
                form.TopMost = false;
            }
コード例 #5
0
        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);
        }
コード例 #6
0
        protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
        {
            // Subsequent launches
            base.OnStartupNextInstance(eventArgs);
            App app = Application.Current as App;

            app.Activate(eventArgs.CommandLine);
        }
コード例 #7
0
 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);
     }
 }
コード例 #8
0
 protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
 {
     if (this.MainForm.WindowState == FormWindowState.Minimized)
     {
         this.MainForm.WindowState = FormWindowState.Normal;
     }
     this.MainForm.Activate();
 }
コード例 #9
0
            void Program_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
            {
                e.BringToForeground = true;
                MainForm form = MainForm as MainForm;

                form.OpenedFiles = e.CommandLine.ToList();
                form.OpenFiles();
            }
コード例 #10
0
 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.
 }
コード例 #11
0
ファイル: Program.cs プロジェクト: FenPhoenix/AngelLoader
 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);
 }
コード例 #12
0
    public static void NewInstanceHandler(object sender, StartupNextInstanceEventArgs e)
    {
        string imageLocation = e.CommandLine[1];

        MessageBox.Show(imageLocation);
        e.BringToForeground = false;
        ControlPanel.uploadImage(imageLocation);
    }
コード例 #13
0
ファイル: Program.cs プロジェクト: bryful/SkeltonVS2021
        public void MyApplication_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
        {
            //ここに二重起動されたときの処理を書く
            //e.CommandLineでコマンドライン引数を取得出来る
            Form1 f = (Form1)this.MainForm;

            f.GetCommand(e.CommandLine.ToArray <string>());
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        private void ApplicationController_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
        {
            e.BringToForeground = true;

            _mainForm.ShowInTaskbar = true;
            _mainForm.WindowState   = FormWindowState.Minimized;
            _mainForm.Show();
            _mainForm.WindowState = FormWindowState.Normal;
        }
コード例 #16
0
        protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e)
        {
            //Give focus to the main instance
            e.BringToForeground = true;

            base.OnStartupNextInstance(e);

            application.NextInstance(e.CommandLine);
        }
コード例 #17
0
 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();
 }
コード例 #18
0
ファイル: Program.cs プロジェクト: Super4ng/Smash-Forge
 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);
     }
 }
コード例 #19
0
        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();
        }
コード例 #20
0
        /// <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();
        }
コード例 #21
0
ファイル: Program.cs プロジェクト: aata/szotar
            protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
            {
                if (HandleCommandLine(eventArgs.CommandLine))
                {
                    return;
                }

                eventArgs.BringToForeground = true;
            }
コード例 #22
0
        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);
        }
コード例 #23
0
 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()
         });
     }
 }
コード例 #24
0
ファイル: Program.cs プロジェクト: dokuflex/Dokuflex
 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]);
     }
 }
コード例 #25
0
 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);
 }
コード例 #26
0
 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;
 }
コード例 #27
0
        protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e)
        {
            if (e.CommandLine.Count > 0)
            {
                app.ProcessCommandLine(e.CommandLine.ToArray());
            }

            app.Activate();
        }
コード例 #28
0
        void SingleInstanceController_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
        {
            if (MainForm.WindowState == FormWindowState.Minimized)
            {
                (MainForm as MainForm).ShowFromTaskBar();
            }

            MainForm.Activate();
        }
コード例 #29
0
 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();
 }
コード例 #30
0
 protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e)
 {
     // 这里可以把本次使用的参数传给之前的实例,本人在一个WPF 屏幕键盘项目里传送了键盘显示方式(数字、英文、手写)参数
     //e.BringToForeground = true;
     //if (e.CommandLine.Count > 0)
     //{
     //  app.DealArgs(e.CommandLine.ToArray());
     //}
 }
コード例 #31
0
 /// <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)
 {
 }
コード例 #34
0
ファイル: Program.cs プロジェクト: renyh1013/dp2
 static void StartupNextInstanceHandler(object sender, StartupNextInstanceEventArgs e)
 {
     // do whatever you want here with e.CommandLine... 
     e.BringToForeground = true;
 }