/// <summary> /// Broadcast a message signalling to listeners that data has been received. /// </summary> protected void BroadcastDataReceived() { EventHandler <ControllerEventArgs> handler = OnDataReceived; // Note that ControllerEventArgs is an Object Pool object to // reduce object creation. These objects should call Dispose() // when they are no longer needed. if (handler != null) { handler(this, ControllerEventArgs.GetInstance(this.Name, "")); } }
/// <summary> /// Broadcast an error message asynchronously to anyone who's listening. /// </summary> /// <param name="Message">The error message</param> protected void BroadcastError(string Message) { EventHandler <ControllerEventArgs> handler = OnError; // Note that ControllerEventArgs is an Object Pool object to // reduce object creation. These objects should call Dispose() // when they are no longer needed. if (handler != null) { handler(this, ControllerEventArgs.GetInstance(this.Name, Message)); } }