19 lines
709 B
C#
19 lines
709 B
C#
using Lattice.Core.Abstractions;
|
||
using Lattice.Core.Models;
|
||
using Lattice.Core.Models.Enums;
|
||
|
||
namespace Lattice.Core.Services;
|
||
|
||
/// <summary>
|
||
/// Простая реализация сервиса уведомлений.
|
||
/// Хранит только событие и вызывает его при Show().
|
||
/// </summary>
|
||
public sealed class NotificationService : INotificationService
|
||
{
|
||
public event EventHandler<NotificationEventArgs>? NotificationReceived;
|
||
|
||
public void Show(string message, NotificationSeverity severity = NotificationSeverity.Info, int durationSeconds = 5)
|
||
{
|
||
NotificationReceived?.Invoke(this, new NotificationEventArgs(message, severity, durationSeconds));
|
||
}
|
||
} |