aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/NotificationDaemon.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-25 10:03:36 -0500
committerMichael <[email protected]>2017-02-25 10:03:36 -0500
commit910a1c455e0176bfff7776e47f9160e349cfaf67 (patch)
tree0d8b17eafb1bd76d3b6daadabc2452bd807d72e1 /ShiftOS_TheReturn/NotificationDaemon.cs
parentea18e37bffacbb8d52b875eecc860dc985ba8bc5 (diff)
downloadshiftos_thereturn-910a1c455e0176bfff7776e47f9160e349cfaf67.tar.gz
shiftos_thereturn-910a1c455e0176bfff7776e47f9160e349cfaf67.tar.bz2
shiftos_thereturn-910a1c455e0176bfff7776e47f9160e349cfaf67.zip
Notification counter on desktop.
Diffstat (limited to 'ShiftOS_TheReturn/NotificationDaemon.cs')
-rw-r--r--ShiftOS_TheReturn/NotificationDaemon.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/ShiftOS_TheReturn/NotificationDaemon.cs b/ShiftOS_TheReturn/NotificationDaemon.cs
index 3a2e96a..3ea8a54 100644
--- a/ShiftOS_TheReturn/NotificationDaemon.cs
+++ b/ShiftOS_TheReturn/NotificationDaemon.cs
@@ -45,6 +45,15 @@ namespace ShiftOS.Engine
notes[note].Read = true;
WriteNotes(notes);
}
+
+ public static int GetUnreadCount()
+ {
+ int c = 0;
+ foreach (var note in GetAllFromFile())
+ if (note.Read == false)
+ c++; //gahh I hate that programming language.
+ return c;
+ }
}
public struct Notification
@@ -57,13 +66,13 @@ namespace ShiftOS.Engine
Timestamp = DateTime.Now;
}
- public bool Read { get; internal set; }
- public NotificationType Type { get; private set; }
- public object Data { get; private set; }
- public DateTime Timestamp { get; private set; }
+ public bool Read { get; set; }
+ public NotificationType Type { get; set; }
+ public object Data { get; set; }
+ public DateTime Timestamp { get; set; }
}
- public enum NotificationType : byte
+ public enum NotificationType
{
Generic = 0x00,
MemoReceived = 0x10,