WPF NotifyIcon

--------------
ADD   Completed events.
FIX   Suppressing second left mouse click event in case of a double click.
CHG   General cleanup.

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@53 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2009-03-30 23:00:01 +00:00
parent 94085b7293
commit 6cc31cea5b
6 changed files with 520 additions and 147 deletions

View File

@@ -24,6 +24,14 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// </summary>
public NotifyIconVersion Version { get; set; }
/// <summary>
/// Used to track whether a mouse-up event is just
/// the aftermath of a double-click and therefore needs
/// to be suppressed.
/// </summary>
private bool isDoubleClick;
#endregion
@@ -47,7 +55,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
public event Action<bool> BallonToolTipChanged;
/// <summary>
/// Fired if the taskbar was created. Requires the taskbar
/// Fired if the taskbar was created or restarted. Requires the taskbar
/// icon to be reset.
/// </summary>
public event Action TaskbarCreated;
@@ -119,11 +127,16 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
case 0x202:
Debug.WriteLine("left up");
MouseEventReceived(MouseEvent.IconLeftMouseUp);
if (!isDoubleClick)
{
MouseEventReceived(MouseEvent.IconLeftMouseUp);
}
isDoubleClick = false;
break;
case 0x203:
Debug.WriteLine("left click 2");
isDoubleClick = true;
MouseEventReceived(MouseEvent.IconDoubleClick);
break;