Table of Contents

Method TryCastDelegate

Namespace
MonoMod.Utils
Assembly
MonoMod.Utils.dll

TryCastDelegate<T>(Delegate, out T)

public static bool TryCastDelegate<T>(this Delegate source, out T result) where T : Delegate

Parameters

source Delegate
result T

Returns

bool

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)

Parameters

source Delegate
type Type
result Delegate

Returns

bool