/// <summary> /// Creates a new IO Block Creator panel for the specified Streamline Core /// </summary> public IOBlockCreatorPanel(StreamlineCore core) { _core = core; _current = new DataConnection(core); _current.Name = _current.InternalName; InitializeComponent(); _ignoreUpdate = true; InputOutputBox.SelectedIndex = 0; _current.IsOutput = false; _ignoreUpdate = false; IOBlockViewer.AttributeList.AllowEnable = false; IOBlockViewer.SetViewingComponent(_current); RefreshBlockListings(); }
/// <summary> /// Determines which block viewer should be shown for the user /// </summary> private void DetermineViewingComponent(object owner, IConnectable c) { var dc = c as DataConnection; if (dc != null) { // Treat as Data Connection BlockViewer.SetViewingComponent(null); IOBlockViewer.SetViewingComponent(dc); IOBlockViewer.UpdateAllComponents(); BlockViewer.Hide(); IOBlockViewer.Show(); } else { // Treat as generic block BlockViewer.SetViewingComponent(c); IOBlockViewer.SetViewingComponent(null); BlockViewer.Show(); IOBlockViewer.Hide(); } }