private void PublishButton_Click(object sender, RoutedEventArgs e) { string value = textBox.Text; if (_transportClient == null) { _transportClient = new CrossProcessTransportClient(); } if (comboBox.SelectedIndex == 0) { //var ribbon = _eventAggregator.GetEvent<RibbonClickTransportEvent>(); //ribbon.Publish(value); _transportClient.Publish("NoSubscriber", value); } if (comboBox.SelectedIndex == 1) { //var ribbon = _eventAggregator.GetEvent<ShortcutTransportEvent>(); //ribbon.Publish(value); _transportClient.Publish("Event1", value); } if (comboBox.SelectedIndex == 2) { //var ribbon = _eventAggregator.GetEvent<ContextChangedTransportEvent>(); //ribbon.Publish(value); _transportClient.Publish("Event2", value); } }
public static void Publish(this ITransportClient transportClient, string name, string value) { transportClient.Publish(new TransportEventArgs(new EventType(name), value)); }
public void WhenShortcutEventPublished() { _transport.Publish("Shortcut", "Event1"); }