Export (0) Print
Expand All

Delegate.Remove Method

Removes the last occurrence of the invocation list of a delegate from the invocation list of another delegate.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static Delegate Remove(
	Delegate source,
	Delegate value
)

Parameters

source
Type: System.Delegate

The delegate from which to remove the invocation list of value.

value
Type: System.Delegate

The delegate that supplies the invocation list to remove from the invocation list of source.

Return Value

Type: System.Delegate
A new delegate with an invocation list formed by taking the invocation list of source and removing the last occurrence of the invocation list of value, if the invocation list of value is found within the invocation list of source. Returns source if value is null or if the invocation list of value is not found within the invocation list of source. Returns a null reference if the invocation list of value is equal to the invocation list of source or if source is a null reference.

ExceptionCondition
MemberAccessException

The caller does not have access to the method represented by the delegate (for example, if the method is private).

ArgumentException

The delegate types do not match.

If the invocation list of value matches a contiguous set of elements in the invocation list of source, then the invocation list of value is said to occur within the invocation list of source. If the invocation list of value occurs more than once in the invocation list of source, the last occurrence is removed.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft