aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-02-25 12:36:26 -0700
committerwilliam341 <[email protected]>2017-02-25 12:36:26 -0700
commitc4f855f3a559195d7b683ec4b96a18c42ce7b5fb (patch)
tree0900c6374d2cb5b2141f534926d1401256b31745
parented5b6549369d470f8aaafbae7716081448377369 (diff)
downloadshiftos_thereturn-c4f855f3a559195d7b683ec4b96a18c42ce7b5fb.tar.gz
shiftos_thereturn-c4f855f3a559195d7b683ec4b96a18c42ce7b5fb.tar.bz2
shiftos_thereturn-c4f855f3a559195d7b683ec4b96a18c42ce7b5fb.zip
fix notification mark as read not updating
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs6
-rw-r--r--ShiftOS_TheReturn/NotificationDaemon.cs2
2 files changed, 8 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 957c793..fdb249a 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -68,6 +68,12 @@ namespace ShiftOS.WinForms
};
+ NotificationDaemon.NotificationRead += (note) =>
+ {
+ btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")";
+
+ };
+
this.LocationChanged += (o, a) =>
{
if (this.Left != 0)
diff --git a/ShiftOS_TheReturn/NotificationDaemon.cs b/ShiftOS_TheReturn/NotificationDaemon.cs
index 3ea8a54..3c710fd 100644
--- a/ShiftOS_TheReturn/NotificationDaemon.cs
+++ b/ShiftOS_TheReturn/NotificationDaemon.cs
@@ -38,12 +38,14 @@ namespace ShiftOS.Engine
public static void MarkRead(int note)
{
+ var lst = new List<Notification>(GetAllFromFile());
var notes = GetAllFromFile();
if (note >= notes.Length || note < 0)
throw new ArgumentOutOfRangeException("note", new Exception("You cannot mark a notification that does not exist as read."));
notes[note].Read = true;
WriteNotes(notes);
+ NotificationMade?.Invoke(lst[lst.Count - 1]);
}
public static int GetUnreadCount()