Mono Class Library: System.Delegate Overview | Members

System.Delegate.RemoveAll Method

Removes all matching occurrences of the invocation list of a Delegate from the invocation list of another delegate.

public static Delegate RemoveAll (Delegate source, Delegate value)

Parameters

source
The delegate from which to remove all matching occurrences of the invocation list of value.
value
The delegate that supplies the invocation list to remove from source.

Returns

Returns a new delegate, source, or null.

If source and value are not null , are not equal, and the invocation list of value is contained in the invocation list of source, returns a new delegate with all matching occurrences of the invocation list of value removed from the invocation list of source.

If the invocation lists of source and value are equal, or if source contains only a succession of invocation lists equal to value, returns null.

If the invocation list of value is not found in the invocation list of source, returns source.

The following table describes the value returned when source or value is null .

sourcevalueReturn value
nullnullnull
nullnon-nullnull
non-nullnullsource

Remarks

The invocation list of value is required to be an exact match of a contiguous set of elements in the invocation list ofsource. If the invocation list of value occurs more than once in the invocation list of source, all occurrences are removed.

Requirements

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