private void OnReceiveCommand(object sender, ReceiveCommandEventArgs e) { string rawContent = e.Command; int i = FindColonCharIndex(rawContent); string command = (i == -1) ? rawContent : rawContent.Substring(0, i); string content = (i == -1) ? "" : rawContent.Substring(i + 1); _dispatcher.ReceiveCommand(new ReceivedCommand(command, content)); }
private void OnReceivedCommand(object?sender, ReceiveCommandEventArgs e) { string content = e.Command; int i = FindColonCharIndex(content); string command = (i == -1) ? content : content.Substring(0, i); string args = (i == -1) ? "" : content.Substring(i + 1); App.Current.Dispatcher.BeginInvoke(new Action( () => ReceivedCommand?.Invoke(this, new CommandReceivedEventArgs(command, args)) )); }