public static void NotifyMessageReceived(this INotifyMessageReceived sender, MessageReceivedEventArgs e) { MessageReceivedEventHandler handler; if (sender == null || e == null || (handler = sender.GetDelegate(EventHandlerName) .GetHandler<MessageReceivedEventHandler>()) == null) { return; } handler(sender, e); }
public static ChatMessage NotifyMessageReceived(this INotifyMessageReceived sender, ChatMessage message) { var e = new MessageReceivedEventArgs(message); sender.NotifyMessageReceived(e); return e.Response; }