C
Carmella
Is it possible for a class to create an instance of a private nested class
which raises events and then listen for those events? In the example below,
when InnerClass sings, OuterClass should say Bravo . I am not sure about the
scoping and I cannot get this to work.
Thanks
Mel
Public Sub OuterClass
Public Event Bravo()
Protected WithEvents MyInnerClass as InnerClass
Public Sub New
MyInnerClass = New InnerClass
End Sub
Private Sub HearSinging() Handles MyInnerClass.Sing
RaiseEvent Bravo()
End Sub
Private InnerClass
Friend Event Sing()
Public Sub New()
SingSomething()
End Sub
Private Sub SingSomething()
RaiseEvent Sing()
End Sub
End Class
End Class
which raises events and then listen for those events? In the example below,
when InnerClass sings, OuterClass should say Bravo . I am not sure about the
scoping and I cannot get this to work.
Thanks
Mel
Public Sub OuterClass
Public Event Bravo()
Protected WithEvents MyInnerClass as InnerClass
Public Sub New
MyInnerClass = New InnerClass
End Sub
Private Sub HearSinging() Handles MyInnerClass.Sing
RaiseEvent Bravo()
End Sub
Private InnerClass
Friend Event Sing()
Public Sub New()
SingSomething()
End Sub
Private Sub SingSomething()
RaiseEvent Sing()
End Sub
End Class
End Class