mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-17 02:51:51 -05:00
Reformatting code (NTFY-20)
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@183 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -32,8 +32,7 @@ using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Threading;
|
||||
using Hardcodet.Wpf.TaskbarNotification.Interop;
|
||||
using Point=Hardcodet.Wpf.TaskbarNotification.Interop.Point;
|
||||
|
||||
using Point = Hardcodet.Wpf.TaskbarNotification.Interop.Point;
|
||||
|
||||
|
||||
namespace Hardcodet.Wpf.TaskbarNotification
|
||||
@@ -89,7 +88,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether a non-tooltip popup is currently opened.
|
||||
/// </summary>
|
||||
@@ -104,13 +102,11 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
return popup != null && popup.IsOpen ||
|
||||
menu != null && menu.IsOpen ||
|
||||
balloon != null && balloon.IsOpen;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Construction
|
||||
|
||||
/// <summary>
|
||||
@@ -146,7 +142,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Custom Balloons
|
||||
|
||||
/// <summary>
|
||||
@@ -221,8 +216,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
popup.StaysOpen = true;
|
||||
|
||||
Point position = TrayInfo.GetTrayLocation();
|
||||
popup.HorizontalOffset = position.X -1;
|
||||
popup.VerticalOffset = position.Y -1;
|
||||
popup.HorizontalOffset = position.X - 1;
|
||||
popup.VerticalOffset = position.Y - 1;
|
||||
|
||||
//store reference
|
||||
lock (this)
|
||||
@@ -437,10 +432,10 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
if (me == MouseEvent.IconLeftMouseUp && !isLeftClickCommandInvoked)
|
||||
{
|
||||
//show context menu once we are sure it's not a double click
|
||||
delayedTimerAction = () => LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
|
||||
delayedTimerAction =
|
||||
() => LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
|
||||
singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -660,7 +655,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
if (TrayPopupResolved.Child != null)
|
||||
{
|
||||
//try to get a handle on the popup itself (via its child)
|
||||
HwndSource source = (HwndSource)PresentationSource.FromVisual(TrayPopupResolved.Child);
|
||||
HwndSource source = (HwndSource) PresentationSource.FromVisual(TrayPopupResolved.Child);
|
||||
if (source != null) handle = source.Handle;
|
||||
}
|
||||
|
||||
@@ -705,6 +700,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
ContextMenu.Placement = PlacementMode.AbsolutePoint;
|
||||
ContextMenu.HorizontalOffset = cursorPosition.X;
|
||||
ContextMenu.VerticalOffset = cursorPosition.Y;
|
||||
|
||||
ContextMenu.IsOpen = true;
|
||||
|
||||
//activate the message window to track deactivation - otherwise, the context menu
|
||||
|
||||
Reference in New Issue
Block a user