Mono Class Library: System.Delegate Overview | Members

System.Delegate.Combine Method

Concatenates the invocation lists of the specified delegates.

[System.Runtime.InteropServices.ComVisible(true)]
public static Delegate Combine (params Delegate[] delegates)

Parameters

delegates
An array of delegates of the exact same type.

Returns

A new delegate, or null if delegates is null or has only null elements.

Exceptions

TypeReason
ArgumentExceptionThe non-null delegates in delegates are not of the same type.

Remarks

The invocation list of the returned delegate is constructed by concatenating the invocation lists of the delegates in delegates, in increasing subscript order. For example, consider the following situation, in which the elements of delegates have the following invocation lists (where En represents an entry in an invocation list, and null represents an empty invocation list): [0] = E1, [1] = null, [2] = E2 + E3, and [3] = E4 + E5 + E6. When these elements are combined, the resulting delegate contains the invocation list E1 + E2 + E3 + E4 + E5 + E6.

Null elements in delegates are not included in the returned delegate.

Note: The invocation list of the returned delegate can contain duplicate methods.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0