/// <summary>
 /// Executes the hotkey action on the specified Window.
 /// </summary>
 /// <param name="window">The Window.</param>
 /// <param name="e">The event arguments</param>
 protected override void IfNoHandlerOnExecute(object window, WindowOnExecuteArgs e)
 {
     if (!e.Window.IsVisible)
     {
         e.Window.Show();
     }
     e.Window.Activate();
 }
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
        public void Execute(object parameter)
        {
            WindowOnExecuteArgs args = new WindowOnExecuteArgs((parameter as Window) ?? Window, parameter);

            if (args.Window != null)
            {
                ExecuteHandler temp = OnExecute;
                if (temp != null)
                {
                    temp(this, args);
                }
                else
                {
                    IfNoHandlerOnExecute(this, args);
                }
            }
        }
Example #3
0
 protected override void IfNoHandlerOnExecute(object window, WindowOnExecuteArgs e)
 {
    _handler.Invoke(window, new CommandEventArgs { Command = _script.ToString() });
 }
Example #4
0
 /// <summary>
 /// Executes the hotkey action on the specified Window.
 /// </summary>
 /// <param name="window">The Window.</param>
 /// <param name="e">The event arguments</param>
 protected override void IfNoHandlerOnExecute(object window, WindowOnExecuteArgs e)
 {
    if (!e.Window.IsVisible)
    {
       e.Window.Show();
       e.Window.Activate();
    }
    else if (!e.Window.IsActive)
    {
       e.Window.Activate();
    }
    else
    {
       e.Window.Hide();
    }
 }
Example #5
0
 /// <summary>
 /// Executes the hotkey action on the specified Window.
 /// </summary>
 /// <param name="window">The Window.</param>
 /// <param name="e">The event arguments</param>
 protected override void IfNoHandlerOnExecute(object window, WindowOnExecuteArgs e)
 {
    e.Window.Hide();
 }
Example #6
0
      /// <summary>
      /// Defines the method to be called when the command is invoked.
      /// </summary>
      /// <param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
      public void Execute(object parameter)
      {
         WindowOnExecuteArgs args = new WindowOnExecuteArgs((parameter as Window) ?? Window, parameter);

         if (args.Window != null)
         {
            ExecuteHandler temp = OnExecute;
            if (temp != null)
            {
               temp(this, args);
            }
            else
            {
               IfNoHandlerOnExecute(this, args);
            }
         }
      }
Example #7
0
 /// <summary>Executes the hotkey action on the specified Window.
 /// </summary>
 /// <param name="source">The Window.</param>
 protected abstract void IfNoHandlerOnExecute(object source, WindowOnExecuteArgs e);
 /// <summary>
 /// Executes the hotkey action on the specified Window.
 /// </summary>
 /// <param name="window">The Window.</param>
 /// <param name="e">The event arguments</param>
 protected override void IfNoHandlerOnExecute(object window, WindowOnExecuteArgs e)
 {
     e.Window.Show();
 }
 /// <summary>Executes the hotkey action on the specified Window.
 /// </summary>
 /// <param name="source">The Window.</param>
 protected abstract void IfNoHandlerOnExecute(object source, WindowOnExecuteArgs e);