TabPageController InitializeTab(TabPage tabPage, bool readOnly, Control container)
        {
            var workflowGraphView = new WorkflowGraphView(serviceProvider, this, readOnly);

            workflowGraphView.BackColorChanged += (sender, e) =>
            {
                tabPage.BackColor = workflowGraphView.BackColor;
                if (tabControl.SelectedTab == tabPage)
                {
                    InitializeTheme(tabPage);
                }
            };
            workflowGraphView.Dock = DockStyle.Fill;
            workflowGraphView.Font = Font;
            workflowGraphView.Tag  = tabPage;

            var tabState = new TabPageController(tabPage, workflowGraphView, this);

            tabPage.Tag = tabState;
            tabPage.SuspendLayout();
            if (container != null)
            {
                container.TextChanged += (sender, e) => tabState.Text = container.Text;
                container.Controls.Add(workflowGraphView);
                tabPage.Controls.Add(container);
            }
            else
            {
                tabPage.Controls.Add(workflowGraphView);
            }
            tabPage.BackColor = workflowGraphView.BackColor;
            tabPage.ResumeLayout(false);
            tabPage.PerformLayout();
            return(tabState);
        }
Example #2
0
        public void UpdateSelection(WorkflowGraphView selectedView)
        {
            if (selectedView == null)
            {
                throw new ArgumentNullException("selectedView");
            }

            SelectedView  = selectedView;
            SelectedNodes = selectedView.GraphView.SelectedNodes;
            OnSelectionChanged(EventArgs.Empty);
        }
        public void SelectTab(WorkflowGraphView workflowGraphView)
        {
            var tabPage = (TabPage)workflowGraphView.Tag;

            if (tabPage != null)
            {
                var tabIndex = tabControl.TabPages.IndexOf(tabPage);
                if (tabIndex >= 0)
                {
                    tabControl.SelectTab(tabIndex);
                }
            }
        }
            public TabPageController(TabPage tabPage, WorkflowGraphView graphView, WorkflowEditorControl editorControl)
            {
                if (tabPage == null)
                {
                    throw new ArgumentNullException("tabPage");
                }

                if (graphView == null)
                {
                    throw new ArgumentNullException("graphView");
                }

                if (editorControl == null)
                {
                    throw new ArgumentNullException("editorControl");
                }

                TabPage           = tabPage;
                WorkflowGraphView = graphView;
                owner             = editorControl;
            }
 public void UpdateVisualizerLayout()
 {
     WorkflowGraphView.UpdateVisualizerLayout();
 }
 public void UpdateSelection()
 {
     WorkflowGraphView.UpdateSelection();
 }
 public void UpdateSelection(WorkflowGraphView selectedView)
 {
     SelectedView  = selectedView ?? throw new ArgumentNullException(nameof(selectedView));
     SelectedNodes = selectedView.GraphView.SelectedNodes;
     OnSelectionChanged(EventArgs.Empty);
 }
Example #8
0
 public TabPageController(TabPage tabPage, WorkflowGraphView graphView)
 {
     TabPage           = tabPage ?? throw new ArgumentNullException(nameof(tabPage));
     WorkflowGraphView = graphView ?? throw new ArgumentNullException(nameof(graphView));
 }