N
nford
Is there a way to check if an object handles a certain type of event or
if the object is hooked up to a certain event handler/call back
function?
For instance what would be the equivalent syntax in the following:
Private x as Object
Public Event TestEvent()
Sub Y()
if (x handles TestEvent) then Write("X Handles TestEvent()")
End Sub
-----------------------------------------------------------------
Private x as Object
Public Event TestEvent()
Sub New()
AddHandler x, AddressOf XHandlerFunction
End Sub
Sub XHandlerFunction()
' handling code
End Sub
Sub CheckHookup()
' Consider multiple handlers
If x.handlers(0) Is XHandlerFunction Then
Write("X has XHandlerFunction() as one of its handlers")
End If
End Sub
if the object is hooked up to a certain event handler/call back
function?
For instance what would be the equivalent syntax in the following:
Private x as Object
Public Event TestEvent()
Sub Y()
if (x handles TestEvent) then Write("X Handles TestEvent()")
End Sub
-----------------------------------------------------------------
Private x as Object
Public Event TestEvent()
Sub New()
AddHandler x, AddressOf XHandlerFunction
End Sub
Sub XHandlerFunction()
' handling code
End Sub
Sub CheckHookup()
' Consider multiple handlers
If x.handlers(0) Is XHandlerFunction Then
Write("X has XHandlerFunction() as one of its handlers")
End If
End Sub