mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Adds basic notification system
This commit is contained in:
1 parent
493f34c883
commit
dc47386726
8 files changed
+304
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Enums.Notifications;
|
||||
using Lumina.Presentation.Web.Common.Models.Common;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Service for showing notifications.
|
||||
/// </summary>
|
||||
public class NotificationService : INotificationService
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
public event Action<NotificationModel>? OnNotification;
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Shows a notification.
|
||||
/// </summary>
|
||||
/// <param name="message">The message of the notification.</param>
|
||||
/// <param name="type">The type of the notification.</param>
|
||||
public void Show(string message, NotificationType type)
|
||||
{
|
||||
OnNotification?.Invoke(new NotificationModel { Message = message, Type = type, Id = Guid.NewGuid() });
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user