Exemplo n.º 1
0
 /// <summary>
 /// Enables "minimize to tray" behavior for the specified Window.
 /// </summary>
 /// <param name="window">Window to enable the behavior for.</param>
 public static void EnableMinimizeToTray(Window window)
 {
     if (MinimizeInstances.ContainsKey(window))
     {
         Console.WriteLine(string.Format("Minimization already enabled for '{0}'", window.Title));
     }
     else
     {
         var instance = new MinimizeToTrayInstance(window);
         instance.Enable();
         MinimizeInstances.Add(window, instance);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Enables "minimize to tray" behavior for the specified Window.
 /// </summary>
 /// <param name="window">Window to enable the behavior for.</param>
 public static void EnableMinimizeToTray(Window window)
 {
     if (MinimizeInstances.ContainsKey(window))
     {
         Console.WriteLine(string.Format("Minimization already enabled for '{0}'", window.Title));
     }
     else
     {
         var instance = new MinimizeToTrayInstance(window);
         instance.Enable();
         MinimizeInstances.Add(window, instance);
     }
 }
Exemplo n.º 3
0
    /// <summary>
    /// Enables "minimize to tray" behavior for the specified Window.
    /// </summary>
    /// <param name="window">Window to enable the behavior for.</param>
    public static void Enable(Window window, bool minimizeNow)
    {
        UIHelpers.HideFromAltTab(window);
        if (MinimizeInstances.ContainsKey(window))
        {
            Console.WriteLine(string.Format("Minimization already enabled for '{0}'", window.Title));
            if (minimizeNow)
            {
                MinimizeInstances[window].MinimizeNow();
            }
        }
        else
        {
            var instance = new MinimizeToTrayInstance(window);
            instance.Enable();
            MinimizeInstances.Add(window, instance);

            if (minimizeNow)
            {
                instance.MinimizeNow();
            }
        }
    }
Exemplo n.º 4
0
 public static void Enable(MainWindow window)
 {
     // No need to track this instance; its event handlers will keep it alive
     var _ = new MinimizeToTrayInstance(window);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Enables "minimize to tray" behavior for the specified Window.
 /// </summary>
 /// <param name="window">Window to enable the behavior for.</param>
 public static void Initialize(Window window, Icon startingIcon)
 {
     _instance = new MinimizeToTrayInstance(window, startingIcon);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Enables "minimize to tray" behavior for the specified Window.
 /// </summary>
 /// <param name="window">Window to enable the behavior for.</param>
 public static void Initialize(Window window, Icon startingIcon)
 {
     _instance = new MinimizeToTrayInstance(window, startingIcon);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Enables "minimize to tray" behavior for the specified Window.
 /// </summary>
 /// <param name="window">Window to enable the behavior for.</param>
 public static void Enable(Window window)
 {
     // No need to track this instance; its event handlers will keep it alive
     instance = new MinimizeToTrayInstance(window);
 }