This commit is contained in:
TheXamlGuy
2024-05-06 21:17:20 +01:00
parent 40845bb5b3
commit ff8e97f030
13 changed files with 145 additions and 26 deletions
+11 -1
View File
@@ -54,7 +54,17 @@ public class SubscriptionManager(SubscriptionCollection subscriptions) :
{
if (interfaceType.GetGenericArguments().FirstOrDefault() is Type argumentType)
{
subscriptions.AddOrUpdate($"{(key is not null ? $"{key}:" : "")}{argumentType}", _ => new List<WeakReference> { new(subscriber) }, (_, collection) =>
if (key is not null)
{
subscriptions.AddOrUpdate($"{key}:{argumentType}", _ => new List<WeakReference> { new(subscriber) }, (_, collection) =>
{
collection.Add(new WeakReference(subscriber));
return collection;
});
}
subscriptions.AddOrUpdate($"{argumentType}", _ => new List<WeakReference> { new(subscriber) }, (_, collection) =>
{
collection.Add(new WeakReference(subscriber));
return collection;