Прочетете на английски Редактиране

Споделяне чрез


Delegate.EnumerateInvocationList<TDelegate>(TDelegate) Method

Definition

Gets an enumerator for the invocation targets of this delegate.

C#
public static Delegate.InvocationListEnumerator<TDelegate> EnumerateInvocationList<TDelegate>(TDelegate? d) where TDelegate : Delegate;

Type Parameters

TDelegate

Delegate type being enumerated.

Parameters

d
TDelegate

The delegate being enumerated.

Returns

A Delegate.InvocationListEnumerator<TDelegate> that follows the IEnumerable pattern and thus can be used in a C# 'foreach' statement to retrieve the invocation targets of this delegate without allocations. The method returns an empty enumerator for null delegate.

Remarks

The order of the delegates returned by the enumerator is the same order in which the current delegate invokes the methods that those delegates represent.

Applies to

Продукт Версии
.NET 9, 10