Delegate.RemoveImpl(Delegate) 方法

定义

从一个委托的调用列表中移除另一个委托的调用列表。Removes the invocation list of a delegate from the invocation list of another delegate.

protected:
 virtual Delegate ^ RemoveImpl(Delegate ^ d);
protected virtual Delegate RemoveImpl (Delegate d);
abstract member RemoveImpl : Delegate -> Delegate
override this.RemoveImpl : Delegate -> Delegate
Protected Overridable Function RemoveImpl (d As Delegate) As Delegate

参数

d
Delegate

委托,它提供要从当前委托的调用列表中移除的调用列表。The delegate that supplies the invocation list to remove from the invocation list of the current delegate.

返回

一个新委托,其调用列表的构成方法为:获取当前委托的调用列表,如果在当前委托的调用列表中找到了 value 的调用列表,则从中移除 value 的调用列表。A new delegate with an invocation list formed by taking the invocation list of the current delegate and removing the invocation list of value, if the invocation list of value is found within the current delegate's invocation list. 如果 valuenull,或者在当前委托的调用列表中没有找到 value 的调用列表,则返回当前委托。Returns the current delegate if value is null or if the invocation list of value is not found within the current delegate's invocation list. 如果 null 的调用列表等于当前委托的调用列表,则返回 valueReturns null if the invocation list of value is equal to the current delegate's invocation list.

异常

调用方不能访问由委托表示的方法(例如,在方法为私有方法的情况下)。The caller does not have access to the method represented by the delegate (for example, if the method is private).

注解

如果 value 的调用列表与当前委托的调用列表中的一组连续元素相匹配,则会在当前委托的调用列表中调用 value 的调用列表。If the invocation list of value matches a contiguous set of elements in the current delegate's invocation list, then the invocation list of value is said to occur within the current delegate's invocation list. 如果 value 的调用列表在当前委托的调用列表中多次出现,则将删除最后一个匹配项。If the invocation list of value occurs more than once in the current delegate's invocation list, the last occurrence is removed.

安全性

ReflectionPermission
当通过 InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])的机制后期绑定调用时。when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). 关联的枚举: MemberAccessAssociated enumeration: MemberAccess

适用于

另请参阅