perf!: events refactored throughout all the project to use Event<> class

All delegate events are refactored to use the Event<TSender> and Event<TSender, TArgument> for performance issues regarding delegate events creating garbage, also this gives us better control on event invocation since C# Delegates did also create unnecessary garbage during Delegate.DynamicInvoke
This commit is contained in:
2025-05-31 00:14:43 +03:00
parent 996e61d0ad
commit 61e2761580
58 changed files with 637 additions and 485 deletions

View File

@@ -8,12 +8,12 @@ public interface IInitializable
/// <summary>
/// Event triggered when the <see cref="Initialize"/> method is called successfully.
/// </summary>
event InitializedEventHandler? OnInitialized;
Event<IInitializable> OnInitialized { get; }
/// <summary>
/// Event triggered when the <see cref="IInitializable"/> method is called successfully.
/// </summary>
event FinalizedEventHandler? OnFinalized;
Event<IInitializable> OnFinalized { get; }
/// <summary>
/// The value indicating whether the entity has been initialized.
@@ -31,7 +31,4 @@ public interface IInitializable
/// </summary>
/// <returns><see cref="true"/> if finalization is successful, otherwise <see cref="false"/>.</returns>
bool Finalize();
delegate void InitializedEventHandler(IInitializable sender);
delegate void FinalizedEventHandler(IInitializable sender);
}