public void Drop(IDropInfo dropInfo) { if (dropInfo.Data is FilteredConnectablesGroup group && group.Scope is IConnectable) { IConnectable connectable = group.Scope as IConnectable; var compatibleProtocols = SelectedController.CompatibleProtocols(connectable).Distinct().ToList(); if (compatibleProtocols.Count == 1) { var connection = SelectedController.Connect(connectable, compatibleProtocols.First()); connection.Length = this.DefaultWireLength; connection.ConduitType = this.DefaultConduitType; connection.ConduitLength = this.DefaultConduitLength; connection.IsPlenum = this.DefaultPlenum; } else { SelectionNeeded = true; CompatibleProtocols = compatibleProtocols; } }
private void selectProtocolExecute() { SelectedController.Connect(SelectedConnectable, SelectedProtocol); cancelProtocolSelectionExecute(); }