private void AddConnection(OutputReference connection) { if (connection.SourceToolId == Tool.Identifier) { throw new Exception("Tool cannot be referenced by itself."); } _outputs.Add(connection); }
private void LinkButton_Click(object sender, RoutedEventArgs e) { if (!(entityList.SelectedItem is Tool srcTool)) { throw new ArgumentNullException(nameof(srcTool)); } Reference = new OutputReference(srcTool.Identifier, entityOutputs.SelectedItem as Output); Close(); }
public ToolConnectionWindow(IEnumerable <Tool> toolControls, Tool currentTool, OutputReference reference = null) { InitializeComponent(); _currentTool = currentTool; Reference = reference; entityList.ItemsSource = toolControls; _outputList.Add(new Output()); entityOutputs.ItemsSource = _outputList; }