WIP to allow mediter handlers to be subscribed to

This commit is contained in:
TheXamlGuy
2024-05-14 22:49:16 +01:00
parent 32829d1cf3
commit 7e57c0d28d
15 changed files with 81 additions and 83 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ using System.Reflection;
namespace Toolkit.Foundation;
public class Publisher(ISubscriptionManager subscriptionManager,
public class Publisher(IHandlerProvider handlerProvider,
IServiceProvider provider,
IDispatcher dispatcher) :
IPublisher
@@ -29,8 +29,8 @@ public class Publisher(ISubscriptionManager subscriptionManager,
List<object?> handlers = provider.GetServices(typeof(NotificationHandlerWrapper<>)
.MakeGenericType(notificationType)).ToList();
foreach (object? handler in subscriptionManager
.GetHandlers(notificationType, key!))
foreach (object? handler in handlerProvider
.Get(notificationType, key!))
{
handlers.Add(handler);
}