This is an extension method to centralize null checks before raising events.
public static class EventExtension
{
public static void RaiseEvent(this EventHandler handler, object obj, T args) where T : EventArgs
{
EventHandler theHandler = handler;
if (theHandler != null)
{
theHandler(obj, args);
}
}
}