Class used to define the arguments of another application instance startup.
Inheritance: System.EventArgs
        /// <summary>Raises the <c>InstanceAwareApplication.StartupNextInstance</c> event.</summary>
        /// <param name="e">The <c>StartupNextInstanceEventArgs</c> instance containing the event data.</param>
        protected virtual void OnStartupNextInstance(StartupNextInstanceEventArgs e)
        {
            EventHandler <StartupNextInstanceEventArgs> startupNextInstanceEvent = StartupNextInstance;

            if (startupNextInstanceEvent != null)
            {
                startupNextInstanceEvent(this, e);
            }
        }
        /// <summary>Called on next application instance startup.</summary>
        /// <param name="args">The parameters used to run the next instance of the application.</param>
        void OnStartupNextApplicationInstance(string[] args)
        {
            var e = new StartupNextInstanceEventArgs(args);

            OnStartupNextInstance(e);

            if (!e.BringToForeground || (MainWindow == null))
            {
                return;
            }

            (new UIPermission(UIPermissionWindow.AllWindows)).Assert();
            if (MainWindow.WindowState == WindowState.Minimized)
            {
                MainWindow.WindowState = WindowState.Normal;
            }

            MainWindow.Activate();
            CodeAccessPermission.RevertAssert();
        }
Exemplo n.º 3
0
 /// <summary>Raises the <c>InstanceAwareApplication.StartupNextInstance</c> event.</summary>
 /// <param name="e">The <c>StartupNextInstanceEventArgs</c> instance containing the event data.</param>
 protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e)
 {
     base.OnStartupNextInstance(e);
     ProcessArgs(e.GetArgs());
 }
        /// <summary>Called on next application instance startup.</summary>
        /// <param name="args">The parameters used to run the next instance of the application.</param>
        void OnStartupNextApplicationInstance(string[] args)
        {
            var e = new StartupNextInstanceEventArgs(args);
            OnStartupNextInstance(e);

            if (!e.BringToForeground || (MainWindow == null))
            {
                return;
            }

            (new UIPermission(UIPermissionWindow.AllWindows)).Assert();
            if (MainWindow.WindowState == WindowState.Minimized)
            {
                MainWindow.WindowState = WindowState.Normal;
            }

            MainWindow.Activate();
            CodeAccessPermission.RevertAssert();
        }
 /// <summary>Raises the <c>InstanceAwareApplication.StartupNextInstance</c> event.</summary>
 /// <param name="e">The <c>StartupNextInstanceEventArgs</c> instance containing the event data.</param>
 protected virtual void OnStartupNextInstance(StartupNextInstanceEventArgs e)
 {
     EventHandler<StartupNextInstanceEventArgs> startupNextInstanceEvent = StartupNextInstance;
     if (startupNextInstanceEvent != null)
     {
         startupNextInstanceEvent(this, e);
     }
 }