Adds basic notification system

This commit is contained in:
BinaryAlley committed 2024-09-20 18:18:22 +03:00
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
}