mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-16 18:49:54 -05:00
CHG If setting the taskbar doesn't work, the control just retries again (and again) rather than throwing an exception. NTFY-6
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@173 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -883,11 +883,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
|||||||
//couldn't create the icon - we can assume this is because explorer is not running (yet!)
|
//couldn't create the icon - we can assume this is because explorer is not running (yet!)
|
||||||
//-> try a bit later again rather than throwing an exception. Typically, if the windows
|
//-> try a bit later again rather than throwing an exception. Typically, if the windows
|
||||||
// shell is being loaded later, this method is being reinvoked from OnTaskbarCreated
|
// shell is being loaded later, this method is being reinvoked from OnTaskbarCreated
|
||||||
Task.Factory.StartNew(() =>
|
// (we could also retry after a delay, but that's currently YAGNI)
|
||||||
{
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
CreateTaskbarIcon();
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -900,7 +896,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Closes the taskbar icon if required.
|
/// Closes the taskbar icon if required.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -908,6 +903,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
|||||||
{
|
{
|
||||||
lock (this)
|
lock (this)
|
||||||
{
|
{
|
||||||
|
//make sure we didn't schedule a creation
|
||||||
|
|
||||||
if (IsTaskbarIconCreated)
|
if (IsTaskbarIconCreated)
|
||||||
{
|
{
|
||||||
Util.WriteIconData(ref iconData, NotifyCommand.Delete, IconDataMembers.Message);
|
Util.WriteIconData(ref iconData, NotifyCommand.Delete, IconDataMembers.Message);
|
||||||
|
|||||||
Reference in New Issue
Block a user