Delegate.Remove(Delegate, Delegate) 方法

定義

移除某代表的召喚清單最後一次出現,從另一授權的召喚列表中移除。

public:
 static Delegate ^ Remove(Delegate ^ source, Delegate ^ value);
public static Delegate Remove(Delegate source, Delegate value);
public static Delegate? Remove(Delegate? source, Delegate? value);
static member Remove : Delegate * Delegate -> Delegate
Public Shared Function Remove (source As Delegate, value As Delegate) As Delegate

參數

source
Delegate

代表從中移除 的 value呼叫清單。

value
Delegate

提供召喚清單的代理人將從召喚清單 source中移除。

傳回

一個新的代理,並由取 的 source 召喚清單並移除最後一次出現的召喚清單 value而成,若 的 value 召喚清單位於 的 source召喚清單中。 若source是,或若 的valuenull調用清單不在 的value調用清單中,則回傳source。 若 的 value 調用清單等於 的 source 調用清單,或 source 為空引用,則回傳一個空參考。

例外狀況

代表類型不一致。

呼叫者無法存取代理所代表的方法(例如,若該方法為私有)。

備註

若 的 value 調用列表與 的 source調用列表中相鄰的元素集合相符,則 的 value 調用列表稱為存在於 的 source調用列表中。 如果 的 value 召喚清單在 的召喚列表中 source出現超過一次,則最後一次出現會被移除。

適用於

另請參閱