Esempio n. 1
0
 private void SourcesDoubleClicked(object sender, MouseButtonEventArgs e)
 {
     SelectedSource = GetSelectedListBoxItem(sender) as Source;
 }
Esempio n. 2
0
 private void sourceDataReady(Source obj)
 {
     if (Sink == null) return;
       if (Source == null) return;
       if (!Source.IsDataReady) return;
       Sink.Value = Source.Value;
 }
Esempio n. 3
0
 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);
       }
 }