private void SourcesDoubleClicked(object sender, MouseButtonEventArgs e) { SelectedSource = GetSelectedListBoxItem(sender) as Source; }
private void sourceDataReady(Source obj) { if (Sink == null) return; if (Source == null) return; if (!Source.IsDataReady) return; Sink.Value = Source.Value; }
private void Connect() { if (SelectedSink != null && SelectedSource != null) { if (SelectedSource.Connection != null && SelectedSource.Connection == SelectedSink.Connection) { SelectedSource.Connection.Disconnect(); SelectedSink = null; SelectedSource = null; return; } if (SelectedSource.Connection != null && SelectedSink.Connection != null && SelectedSink.Connection != SelectedSource.Connection) { SelectedSource = null; SelectedSink = null; return; } if (!Connection.CheckConnectorCompatibility(SelectedSource, SelectedSink)) { _selectedSink = null; return; } var connection = new Connection(); connection.Sink = SelectedSink; connection.Source = _selectedSource; SelectedSink = null; SelectedSource = null; RaiseConnectionCreated(connection); } }