From f4ce36a18a125160dc3faa1110e060e9a58a7274 Mon Sep 17 00:00:00 2001 From: william341 Date: Sat, 25 Feb 2017 15:02:40 -0700 Subject: [PATCH 1/2] kek i should push dis --- ShiftOS_TheReturn/NotificationDaemon.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ShiftOS_TheReturn/NotificationDaemon.cs b/ShiftOS_TheReturn/NotificationDaemon.cs index f9bfed2..034db7e 100644 --- a/ShiftOS_TheReturn/NotificationDaemon.cs +++ b/ShiftOS_TheReturn/NotificationDaemon.cs @@ -35,24 +35,17 @@ namespace ShiftOS.Engine NotificationMade?.Invoke(lst[lst.Count - 1]); } - - public static void MarkAllRead() - { - var notes = GetAllFromFile(); - for (int i = 0; i < notes.Length; i++) - MarkRead(i); - } + public static event Action NotificationRead; public static void MarkRead(int note) { - var lst = new List(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]); + NotificationRead?.Invoke(); } public static int GetUnreadCount() From 8a60eba70b4875c7e382b933d1c835f6f857cdd0 Mon Sep 17 00:00:00 2001 From: william341 Date: Sat, 25 Feb 2017 15:04:35 -0700 Subject: [PATCH 2/2] infernal noises from hell (aka DooM --- ShiftOS_TheReturn/NotificationDaemon.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ShiftOS_TheReturn/NotificationDaemon.cs b/ShiftOS_TheReturn/NotificationDaemon.cs index 034db7e..6eb0b7b 100644 --- a/ShiftOS_TheReturn/NotificationDaemon.cs +++ b/ShiftOS_TheReturn/NotificationDaemon.cs @@ -37,6 +37,13 @@ namespace ShiftOS.Engine public static event Action NotificationRead; + public static void MarkAllRead() + { + var notes = GetAllFromFile(); + for (int i = 0; i < notes.Length; i++) + MarkRead(i); + } + public static void MarkRead(int note) { var notes = GetAllFromFile(); @@ -56,6 +63,7 @@ namespace ShiftOS.Engine c++; //gahh I hate that programming language. return c; } + } public struct Notification