ServiceManager.RemoveCallback Method
Removes a callback method from a delegate.
Namespace: Microsoft.Windows.Design
Assembly: Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)
Syntax
'Declaration
Protected Shared Function RemoveCallback ( _
existing As Delegate, _
toRemove As Delegate _
) As Delegate
protected static Delegate RemoveCallback(
Delegate existing,
Delegate toRemove
)
protected:
static Delegate^ RemoveCallback(
Delegate^ existing,
Delegate^ toRemove
)
static member RemoveCallback :
existing:Delegate *
toRemove:Delegate -> Delegate
protected static function RemoveCallback(
existing : Delegate,
toRemove : Delegate
) : Delegate
Parameters
- existing
Type: System.Delegate
The delegate to remove the callback from.
- toRemove
Type: System.Delegate
The callback method to remove from the delegate.
Return Value
Type: System.Delegate
A new delegate to replace the existing delegate. If existing is nulla null reference (Nothing in Visual Basic), returns nulla null reference (Nothing in Visual Basic). If toRemove is nulla null reference (Nothing in Visual Basic), returns existing.
Remarks
This method knows how to unwrap delegates that are proxies to generic callbacks. If the delegate was created to proxy a generic delegate, this method removes the original object, not the proxy.
You can use this method in your implementation of Unsubscribe.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design Namespace