Renamed property and used IsSubclassOf to allow generics

This commit is contained in:
David Higueros committed 2026-11-03 19:05:24 -07:00
1 parent d83bcde8a9
commit 7755274863
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ public static class MiraEventManager
return false;
}
var callableHandlers = handlers.Where(x => x.ConstructedType.IsAssignableTo(type)).ToList();
var callableHandlers = handlers.Where(x => IsSubclassOf(type, x.DefinedType)).ToList();
if (callableHandlers.Count == 0)
{
return false;
+2 -2
View File
@@ -17,7 +17,7 @@ public class MiraEventWrapper
/// </summary>
public int Priority { get; }
internal Type ConstructedType { get; }
internal Type DefinedType { get; }
/// <summary>
/// Initializes a new instance of the <see cref="MiraEventWrapper"/> class.
@@ -29,6 +29,6 @@ public class MiraEventWrapper
{
EventHandler = eventHandler;
Priority = priority;
ConstructedType = type;
DefinedType = type;
}
}