Method TryCastDelegate
TryCastDelegate<T>(Delegate, out T)
public static bool TryCastDelegate<T>(this Delegate source, out T result) where T : Delegate
Parameters
sourceDelegateresultT
Returns
Type Parameters
T
TryCastDelegate(Delegate, Type, out Delegate?)
[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "The whole point of this method is to swallow an exception and return false")]
public static bool TryCastDelegate(this Delegate source, Type type, out Delegate? result)