Related Articles

1 user responded in this post

Subscribe to this post comment rss or trackback url
User Gravatar
Oleg Sych said in May 4th, 2008 at 12:21 am

What would be the advantage in using the Simple Event Broker compared to something like this:

public static class MyEvents {
public static event EventHandler TransactionComplete;
public static void OnTransactionComplete(object sender, EventArgs e) {
if (TransactionComplete != null)
TransactionComplete(sender, e);
};
}

class Publisher {
void DoStuff() {
MyEvents.OnTransactionComplete(this, new EventArgs());
}
}

class Subscriber {
public Subscriber() {
MyEvents.TransactionComplete += TransactionCompleteHandler;
}

public void TransactionCompleteHandler(object sender, EventArgs e) {
//Do Something…..
}
}

Leave A Reply

 Username (Required)

 Email Address (Remains Private)

 Website (Optional)