Skip to content

Commit

Permalink
Notifications: Adding a simple overload to straightly add a new notif…
Browse files Browse the repository at this point in the history
…ication.
  • Loading branch information
L33T committed Feb 18, 2015
1 parent 3011c3a commit f4245ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Notifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ public static bool AddNotification(INotification notification)
return (notification != null) && NotificationsList.TryAdd(notification.GetId(), notification);
}

/// <summary>
/// Adds a simple notification to the notification list
/// </summary>
/// <param name="text">Display Text</param>
/// <param name="duration">Duration (-1 for infinite)</param>
/// <param name="dispose">Dispose upon ending</param>
/// <returns></returns>
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;
}

/// <summary>
/// Removes a notification from the notification list
/// </summary>
Expand Down

0 comments on commit f4245ad

Please sign in to comment.