Hi,
I think know how to do this in C# but I'm having syntax trouble in VB.NET because I need to take advantage of the 'handles' event stuff.
I have different events that I somehow (probably delegate) need stored in a property of an attribute (I just add an attribute to a property linking to the corresponding event).
E.g.
<BindEvent(EventThing)>_
Public ReadOnly Property IsTrue() As Boolean
Get
Return True
End Get
End Property
They need to be events so that other programmers can use the VB.NET handles keyword on methods.
Public Delegate Sub TestEvent(ByVal sender As Object, ByVal e As Object)
Public Event E As TestEvent
Public Sub Test() Handles E
End Sub
These properties are already raising a general event, which I am catching, determining the related property and thus getting the related attribute (and delegate/event). I want to then raise the event that's related.
If I just use a delegate tied to the particular event that won't raise other handlers will it?
I also want to avoid having to write a sub for each property that just uses Raise Event on the event type if possible as this seems redundant.
e.g. avoid:
Public Event E As TestEvent
Public Sub CallE(ByVal sender As Object, ByVal e As Object)
RaiseEvent E(sender, e)
End Sub
<BindDelegate(DelegateToCallE)>_
Public ReadOnly Property IsTrue() As Boolean
Get
Return True
End Get
End Property