From f4245ad52741196c92d51cd618acb4411469a282 Mon Sep 17 00:00:00 2001 From: L33T Date: Wed, 18 Feb 2015 16:48:19 +0200 Subject: [PATCH] Notifications: Adding a simple overload to straightly add a new notification. --- Notifications.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Notifications.cs b/Notifications.cs index 4e6e5b50..924c9b69 100644 --- a/Notifications.cs +++ b/Notifications.cs @@ -83,6 +83,20 @@ public static bool AddNotification(INotification notification) return (notification != null) && NotificationsList.TryAdd(notification.GetId(), notification); } + /// + /// Adds a simple notification to the notification list + /// + /// Display Text + /// Duration (-1 for infinite) + /// Dispose upon ending + /// + public static Notification AddNotification(string text, int duration = -0x1, bool dispose = true) + { + var notification = new Notification(text, duration, dispose); + NotificationsList.TryAdd(notification.GetId(), notification); + return notification; + } + /// /// Removes a notification from the notification list ///