My job is requiring some visual basic programming and i've only programmed in C#.
So i have this code:
Public Custom Event Command As JQDialogEventHandler
AddHandler(ByVal value As JQDialogEventHandler)
commandHandler += value
End AddHandler
RemoveHandler(ByVal value As JQDialogEventHandler)
If commandHandler IsNot Nothing Then
commandHandler -= value
End If
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
I'm getting the error: Operator '+' is not defined for types 'ControlesModificados.ControlesModificados.JQDialogEventHandler' and 'ControlesModificados.ControlesModificados.JQDialogEventHandler'.
How can i write this code "commandHandler -= value" in other way so the error goes away! or how can i defined those operators for the eventhandler.
Thank you.
EDITED
More code:
Namespace ControlesModificados
Public Class JQDialogButton
Inherits Button
Private commandHandler As JQDialogEventHandler
Public Custom Event DialogCommand As JQDialogEventHandler
AddHandler(ByVal value As JQDialogEventHandler)
commandHandler += value
End AddHandler
RemoveHandler(ByVal value As JQDialogEventHandler)
If commandHandler IsNot Nothing Then
commandHandler -= value
End If
End RemoveHandler
End Event
...
Protected Overrides Sub OnClick(ByVal e As EventArgs)
If commandHandler IsNot Nothing Then
commandHandler(Me, New JQDialogEventArgs() With { _
.CommandArgument = Me.CommandArgument, _
.CommandName = Me.CommandName _
})
Else
MyBase.OnClick(e)
End If
End Sub
As you can see the DialogCommand is using another JQDialogHandler, so i can't just use
Public Custom Event DialogCommand As JQDialogEventHandler