コード例 #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);
     }
 }
コード例 #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);
     }
 }
コード例 #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();
            }
        }
    }
コード例 #4
0
ファイル: MinimizeToTray.cs プロジェクト: Wolfteam/CastIt
 public static void Enable(MainWindow window)
 {
     // No need to track this instance; its event handlers will keep it alive
     var _ = new MinimizeToTrayInstance(window);
 }
コード例 #5
0
ファイル: MinimizeToTray.cs プロジェクト: kirby561/PushToTalk
 /// <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);
 }
コード例 #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);
 }
コード例 #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);
 }