EventInfoExtensionsRemoveEventHandler Method
Removes an event handler from an event source.
Namespace: DevCase.Extensions.EventInfoExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static void RemoveEventHandler(
this EventInfo eventInfo,
Component target,
string handlerName
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Sub RemoveEventHandler (
eventInfo As EventInfo,
target As Component,
handlerName As String
)
Dim eventInfo As EventInfo
Dim target As Component
Dim handlerName As String
eventInfo.RemoveEventHandler(target,
handlerName)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static void RemoveEventHandler(
EventInfo^ eventInfo,
Component^ target,
String^ handlerName
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member RemoveEventHandler :
eventInfo : EventInfo *
target : Component *
handlerName : string -> unit
No code example is currently available or this language may not be supported.
- eventInfo EventInfo
-
The event information.
- target Component
-
The event source.
- handlerName String
-
The name of the delegate to be disassociated from the events raised by target.
Note: the name is case-sensitive.
In Visual Basic and C#, you can call this method as an instance method on any object of type
EventInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Shown
Dim target As Form = Me
Dim eventInfo As EventInfo = target.GetType().GetEvent(NameOf(Form.Click))
eventInfo.RemoveEventHandler(target, NameOf(Me.Form1_Click))
End Sub
Private Sub Form1_Click(sender As Object, e As EventArgs) Handles MyBase.Click
MsgBox(MethodBase.GetCurrentMethod().Name)
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.