private void HandleInputMessageReceived(object sender, ChannelMessageEventArgs args) { _uiCtx.Post(o => { // Create new channel message object and add to session ChannelMessage msg = args.Message; if (MessageReceived != null) { MessageReceived(this, SanfordUtils.ConvertChannelMessageToKeyStrokeEventArgs(msg)); } }, null); }
public void Send(object sender, PianoKeyStrokeEventArgs args) { if (args == null) { return; } if (IsInitialised) { try { _logger.Log(this, LogLevel.Info, "Sending message"); _outputDevice.Send(SanfordUtils.ConvertKeyStrokeEventArgsToChannelMessage(args)); } catch (Exception ex) { //Catch ex... } } }