EventBroker is limited to EventHandler/Generic

Topics: CAB & Smart Client Software Factory
Dec 8, 2005 at 11:26 AM
originally posted by: danipham

I don't see why EventBroker is limited to event of type EventHandler and EventHandler<Type>.

It is not posible not declare this :
EventPublication("topic://MyApp/Input")
public event KeyEventHandler KeyPress;

EventSubscription("topic://MyApp/Input")
public void OnKeyPress(object sender, KeyEventArgs e)

Removing the check: ThrowIfInvalidEventHandler(publishedEvent);
in the "Publication" class
in the method "public Publication(EventTopic topic, object publisher, string eventName, WorkItem workItem, PublicationScope scope)"
makes it works fine!

Could you help me to see the reason behind the limitation?
Dec 9, 2005 at 5:08 AM
originally posted by: DLorenz

It is possible. You need to do the following:

EventPublication("topic://MyApp/Input")
public event KeyEventHandler As EventHandler(Of DataEventArgs(Of KeyEventArgs))

...
Raiseevent KeyEventHandler(sender, new DataEventArgs(Of KeyEventArgs)(e))

EventSubscription("topic://MyApp/Input")
public void OnKeyPress(object sender, DataEventArgs(Of KeyEventArgs) e)
Dec 9, 2005 at 7:26 AM
originally posted by: danipham

Thanks. But I still not see the reason of the check