Benachrichtigungen verschwinden nicht mehr einfach

This commit is contained in:
Lyndon Jetten
2020-09-15 13:42:46 +02:00
parent a6627d1b97
commit fdc262d1ee
5 changed files with 18 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ using ChatController.HauptKlassen;
using ChatController.LoginKlassen;
using ChatController.Utilities;
using ChatController.Utilities.Extensions;
using Application = System.Windows.Forms.Application;
using Button = System.Windows.Controls.Button;
using Cursors = System.Windows.Input.Cursors;
using DataFormats = System.Windows.DataFormats;
@@ -244,10 +245,11 @@ namespace ChatController
SelectContact(_ContactList.FirstOrDefault(f => f.GroupId.Equals(pGroupId)));
};
notifyIcon.BalloonTipClosed += (sender, args) =>
{
DisposeAndRemoveNotification((NotifyIcon)sender, pGroupId);
// TODO: wird beim ausblenden bzw. automatischem Schließen des "Balloons" ausgelöst
//DisposeAndRemoveNotification((NotifyIcon)sender, pGroupId);
};
_Group2NotifyIcons.AddOrUpdateValueInDictionary(pGroupId, notifyIcon);
@@ -261,7 +263,9 @@ namespace ChatController
{
foreach(var notifyIcon in group2NotifyIcon.Value)
{
notifyIcon.Icon = null;
notifyIcon.Dispose();
Application.DoEvents();
}
}
@@ -272,6 +276,9 @@ namespace ChatController
{
pNotification.Dispose();
_Group2NotifyIcons.Remove(pGroupId);
Application.DoEvents();
}
public void ResetStyle()