Table of Contents

Method CastDelegate

Namespace
MonoMod.Utils
Assembly
MonoMod.Utils.dll

CastDelegate<T>(Delegate)

Cast a delegate from one type to another. Compatible with delegates holding an invocation list (combined delegates).
public static T CastDelegate<T>(this Delegate source) where T : Delegate

Parameters

source Delegate
The input delegate.

Returns

T
The output delegate.

Type Parameters

T

CastDelegate(Delegate?, Type)

Cast a delegate from one type to another. Compatible with delegates holding an invocation list (combined delegates).
public static Delegate? CastDelegate(this Delegate? source, Type type)

Parameters

source Delegate
The input delegate.
type Type
The wanted output delegate type.

Returns

Delegate
The output delegate.