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
)
public static Delegate Remove (
	Delegate source, 
	Delegate value
)
public static function Remove (
	source : Delegate, 
	value : Delegate
) : Delegate
Not applicable.

Parameters

source

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

value

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

Return Value

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 a null reference (Nothing in Visual Basic) 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.

Exception typeCondition

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.

Windows Mobile 2003 for Pocket PC, Windows Mobile 2003 for Smartphone, Windows CE Platform Note: If the delegate types do not match, the .NET Compact Framework does not throw a ArgumentException but the operation fails.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft