bob.g....@googlemail.com
unread,Apr 6, 2012, 11:36:27 AM4/6/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bbvc...@googlegroups.com
Ive started using the bbv.Common.EventBroker. Again a real cool bit of code. Real handy to bubble up events from below to the UI.
I'm following the basic tutorial. My publisher is
public class Publisher
{
[EventPublication(EventTopics.HBMissedEvent)]
public event EventHandler HBMissedEvent;
///<summary>Fires the SimpleEvent</summary>
public void CallHBMissedEvent()
{
HBMissedEvent(this, EventArgs.Empty);
}
}
with my scubscriber is
public class Subscriber
{
[EventSubscription(
EventTopics.HBMissedEvent,
typeof(Zeta.Events.Publisher))]
public void HBMissedEvent(object sender, EventArgs e)
{
Console.WriteLine("Heartbeat missed");
}
}
with a very basic EventBroker setup as follows:
Broker = new EventBroker();
Pub = new Publisher();
Broker.Register(Pub);
Sub = new Subscriber();
Broker.Register(Sub);
Pub.CallHBMissedEvent();
but get an exception of {"handlerType 'Zeta.Events.Publisher' has to be a class implementing bbv.Common.EventBroker.IHandler."} . Perhaps something to do with the attribute definiton, on subscriber. Do I need to implement IHander on the publisher. Simple docs don't detail, nor does any of the tests seem to implement IHandler, for simple scenario like this.
Thanks,
Bob.