This commit is contained in:
Eauldane
2025-08-22 02:19:48 +01:00
commit a4c82452be
373 changed files with 52044 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
using Microsoft.Extensions.Logging;
namespace MareSynchronos.Services.Mediator;
public abstract class MediatorSubscriberBase : IMediatorSubscriber
{
protected MediatorSubscriberBase(ILogger logger, MareMediator mediator)
{
Logger = logger;
Logger.LogTrace("Creating {type} ({this})", GetType().Name, this);
Mediator = mediator;
}
public MareMediator Mediator { get; }
protected ILogger Logger { get; }
protected void UnsubscribeAll()
{
Logger.LogTrace("Unsubscribing from all for {type} ({this})", GetType().Name, this);
Mediator.UnsubscribeAll(this);
}
}