Delegate::RemoveAll Method (Delegate^, Delegate^)
Removes all occurrences of the invocation list of a delegate from the invocation list of another delegate.
Assembly: mscorlib (in mscorlib.dll)
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 all occurrences 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, if source contains only a series of invocation lists that are equal to the invocation list of value, or if source is a null reference.
| Exception | Condition |
|---|---|
| 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, all occurrences are removed.
when invoked late-bound through mechanisms such as Type::InvokeMember. Associated enumeration: ReflectionPermissionFlag::MemberAccess
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1