M
MeltingPoint
Just wondering if this is the right way to do things, or if there's a
better way.
<code>
Public Class UserClass //This is the class I want the user to use//
Event UserEvent(ByVal s As String)
Public Sub DoSomething()
Dim pc as New MyFriendClass
AddHandler pc.MyFriendEvent, AddressOf Me.RaiseUserEvent
pc.WorkAway
End Sub
Public Sub RaiseUserEvent(ByVal s As String)
RaiseEvent UserEvent(s)
End Sub
End Class
Friend Class MyPrivateClass
Event MyPrivateEvent(ByVal s As String)
Public Sub WorkAway()
...
RaiseEvent MyPrivateEvent(s)
End Sub
End Class
</code>
I hope this code makes sense to you, and if it does, is it right? Is
there a better way to raise events between classes?
Thanks for your time,
MP
better way.
<code>
Public Class UserClass //This is the class I want the user to use//
Event UserEvent(ByVal s As String)
Public Sub DoSomething()
Dim pc as New MyFriendClass
AddHandler pc.MyFriendEvent, AddressOf Me.RaiseUserEvent
pc.WorkAway
End Sub
Public Sub RaiseUserEvent(ByVal s As String)
RaiseEvent UserEvent(s)
End Sub
End Class
Friend Class MyPrivateClass
Event MyPrivateEvent(ByVal s As String)
Public Sub WorkAway()
...
RaiseEvent MyPrivateEvent(s)
End Sub
End Class
</code>
I hope this code makes sense to you, and if it does, is it right? Is
there a better way to raise events between classes?
Thanks for your time,
MP