chore: removed DelegateExtensions.InvokeSafe
This commit is contained in:
parent
45524e474e
commit
a02584f3b6
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Syntriax.Engine.Core;
|
||||
|
||||
public static class DelegateExtensions
|
||||
{
|
||||
[Obsolete($"{nameof(InvokeSafe)} causes memory allocation, please use Invoke() instead.")]
|
||||
public static void InvokeSafe(this Delegate @delegate, params object?[] args)
|
||||
{
|
||||
foreach (Delegate invocation in Delegate.EnumerateInvocationList(@delegate))
|
||||
try { invocation.DynamicInvoke(args); }
|
||||
catch (Exception exception)
|
||||
{
|
||||
string methodCallRepresentation = $"{invocation.Method.DeclaringType?.FullName}.{invocation.Method.Name}({string.Join(", ", args)})";
|
||||
Console.WriteLine($"Unexpected exception on invocation of method {methodCallRepresentation}:{Environment.NewLine}{exception.InnerException}");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user