add NotificationService, cleanup

This commit is contained in:
Stanley Dimant
2023-01-31 14:43:22 +01:00
parent 12f0789e9c
commit 576d005b32
17 changed files with 243 additions and 84 deletions

View File

@@ -0,0 +1,16 @@
namespace MareSynchronos.Mediator;
public abstract class MediatorSubscriberBase : IDisposable
{
protected MediatorSubscriberBase(MareMediator mediator)
{
Mediator = mediator;
}
protected readonly MareMediator Mediator;
public virtual void Dispose()
{
Mediator.UnsubscribeAll(this);
}
}

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dalamud.Interface.Internal.Notifications;
namespace MareSynchronos.Mediator;
@@ -37,4 +33,6 @@ public record PlayerRelatedObjectPointerUpdateMessage(IntPtr[] RelatedObjects) :
public record HaltScanMessage(string Source) : IMessage;
public record ResumeScanMessage(string Source) : IMessage;
public record NotificationMessage
(string Title, string Message, NotificationType Type, uint TimeShownOnScreen = 3000) : IMessage;
#pragma warning restore MA0048 // File name must match type name