Exemple #1
0
 private void tvNavigation_NodeMouseClick(EventArgs e, PureComponents.TreeView.Node oNode)
 {
     // Select only this area/item if navigation node clicked.
     if (Control.ModifierKeys == Keys.None)
     {
         NavigationTreeView.ClearNodeSelection();
         oNode.Select();
     }
 }
Exemple #2
0
 public void PerformInitialParsing(NavigationTreeView navTree = null)
 {
     if (navTree == null)
     {
         navTree = _findWindowDelegate().NavigationTreeView;
     }
     if (_jsParserService.Code != null)
     {
         var result = _jsParserService.Process(_jsParserService.Code, skipHashCheck: true);
         if (navTree != null)
         {
             navTree.UpdateTree(result, _jsParserService.Code);
         }
     }
 }
Exemple #3
0
        private void FileCloseProject()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new FileCloseProjectDelegate(FileCloseProject), new object[] { });
            }

            else
            {
                frmFlowChart.State.ProjectAttached = false;
                SetButtonStates();

                frmFlowChart.UnSetProject();

                frmFlowChart.Close();
                NavigationTreeView.Clear();
                ovOverview.Document = null;
            }
        }
Exemple #4
0
        private void tvNavigation_AfterNodePositionChange(PureComponents.TreeView.Node oNode)
        {
            NavigationTreeView.ClearNodeSelection();

            foreach (MindFusion.FlowChartX.ChartObject chartObject in frmFlowChart.FlowChart.Objects)
            {
                chartObject.Visible = false;
            }

            RePathNodes(oNode);

            if (oNode.Parent != null)
            {
                oNode.Parent.Select();
            }

            else
            {
                oNode.Select();
            }
        }
Exemple #5
0
        private void SelectSubNodes(PureComponents.TreeView.Node node)
        {
            bool isSelected  = node.IsSelected;
            bool wasSelected = wasSelectedNodes.Contains(node);

            if (wasSelected == isSelected)
            {
                // Nothings changed at area level, update flowchart with innerNodes selection status.
                foreach (PureComponents.TreeView.Node innerNode in node.Nodes)
                {
                    frmFlowChart.State.SetVisible(innerNode.Key, innerNode.IsSelected);

                    SelectSubNodes(innerNode);
                }
            }

            else if (wasSelected && !isSelected)
            {
                // Been deselected, deselect all underlings and update flowchart.
                foreach (PureComponents.TreeView.Node innerNode in node.Nodes)
                {
                    frmFlowChart.State.SetVisible(innerNode.Key, false);

                    NavigationTreeView.RemoveSelectedNode(innerNode);
                    SelectSubNodes(innerNode);
                }
            }

            else if (!wasSelected && isSelected)
            {
                // Been selected, select all underlings and update flowchart.
                foreach (PureComponents.TreeView.Node innerNode in node.Nodes)
                {
                    frmFlowChart.State.SetVisible(innerNode.Key, true);

                    NavigationTreeView.AddSelectedNode(innerNode);
                    SelectSubNodes(innerNode);
                }
            }
        }
Exemple #6
0
        /// <summary>
        /// Standard constructor for the tool window.
        /// </summary>
        public JsParserToolWindow() :
            base(null)
        {
            // Set the window title reading it from the resources.
            this.Caption = Resources.Resources.ToolWindowTitle;
            // Set the image that will appear on the tab of the window frame
            // when docked with an other window
            // The resource ID correspond to the one defined in the resx file
            // while the Index is the offset in the bitmap strip. Each image in
            // the strip being 16x16.
            this.BitmapResourceID = 301;
            this.BitmapIndex      = 0;

            //Force load of a referenced assembly - this is workaround of bug when sometimes WPF cant load it and throws an exception.
            Assembly.Load(typeof(NavigationTreeView).Assembly.FullName);

            // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
            // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
            // the object returned by the Content property.

            base.Content = new JsParserNavTreeHolder();

            _navigationTreeView = (NavigationTreeView)((WindowsFormsHost)(((Panel)(((JsParserNavTreeHolder)Content).Content)).Children[0])).Child;
        }
 public bool ContainsBrowsable(IBrowsable browsable)
 {
     return(NavigationTreeView.ContainsBrowsable(browsable));
 }
        public string ShowParentOfBrowsableInView(IBrowsable browsable, out IBrowsable[] path)
        {
            var result = NavigationTreeView.ShowParentOfBrowsableInView(browsable, out path);

            return(result.ToString());
        }
        public string ShowBrowsableInView(IBrowsable browsable)
        {
            var result = NavigationTreeView.ShowBrowsableInView(browsable);

            return(result.ToString());
        }
 public void ChangeViewScopes(string[] viewScopes)
 {
     NavigationTreeView.ChangeViewScopes(viewScopes);
 }
Exemple #11
0
        public void LoadProject(ClientProtocol clientProtocol, Config config)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new LoadProjectDelegate(LoadProject), new object[] { clientProtocol, config });
            }
            else
            {
                // Close the one selected.
                if (frmFlowChart != null)
                {
                    FileCloseProject();
                }

                clientProtocol.Connect("SysCAD10\nConnection: Client");
                config.Syncxxx();

                Refresh();

                frmFlowChart = new FrmFlowChart(this);

                SuspendLayout();
                frmFlowChart.SuspendLayout();
                frmFlowChart.FlowChart.SuspendLayout();
                NavigationTreeView.SuspendLayout();

                frmFlowChart.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                frmFlowChart.MdiParent = this;
                frmFlowChart.Text      = clientProtocol.Name;

                frmFlowChart.SetProject(clientProtocol, config, NavigationTreeView);

                ovOverview.Document = frmFlowChart.FlowChart;

                frmFlowChart.FlowChart.SelectionChanged += new SelectionEvent(this.frmFlowChart_fcFlowChart_SelectionChanged);

                graphicPropertyGrid.LinkChanged += frmFlowChart.PropertyGridLinkChanged;
                graphicPropertyGrid.NodeChanged += frmFlowChart.PropertyGridNodeChanged;

                {
                    Dictionary <String, Bitmap> modelThumbnails = new Dictionary <String, Bitmap>();
                    //Dictionary<String, Bitmap> graphicThumbnails = new Dictionary<String, Bitmap>();

                    FlowChart thumbnailFlowchart = new FlowChart();

                    foreach (String key in frmFlowChart.State.Config.ModelStencils.Keys)
                    {
                        ModelStencil stencil = config.ModelStencils[key];
                        thumbnailFlowchart.DocExtents   = frmFlowChart.FlowChart.ClientToDoc(new System.Drawing.Rectangle(0, 0, 17, 17));
                        thumbnailFlowchart.ShadowsStyle = ShadowsStyle.None;
                        thumbnailFlowchart.BackColor    = System.Drawing.SystemColors.Window;
                        thumbnailFlowchart.AntiAlias    = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                        RectangleF boxRect = thumbnailFlowchart.ClientToDoc(new System.Drawing.Rectangle(1, 1, 13, 13));
                        Box        box     = thumbnailFlowchart.CreateBox(boxRect.X, boxRect.Y, boxRect.Width, boxRect.Height);
                        box.Style      = BoxStyle.Shape;
                        box.Shape      = State.GetShapeTemplate(stencil, false, false);
                        box.FillColor  = System.Drawing.Color.FromArgb(220, 222, 184, 136);
                        box.FrameColor = System.Drawing.Color.FromArgb(255, 111, 92, 68);
                        box.Locked     = true;
                        modelThumbnails.Add(key, thumbnailFlowchart.CreateImage());
                        thumbnailFlowchart.DeleteObject(box);
                    }

                    stencilChooser1.PopulateTree(modelThumbnails, config.ModelStencils);
                }

                frmFlowChart.State.ProjectAttached = true;
                SetButtonStates();

                frmFlowChart.Show();

                this.NavigationTreeView.NodeSelectionChange     += new System.EventHandler(this.tvNavigation_NodeSelectionChange);
                this.NavigationTreeView.AfterNodePositionChange += new PureComponents.TreeView.TreeView.AfterNodePositionChangeEventHandler(this.tvNavigation_AfterNodePositionChange);
                this.NavigationTreeView.NodeMouseClick          += new PureComponents.TreeView.TreeView.NodeMouseClickEventHandler(this.tvNavigation_NodeMouseClick);

                NavigationTreeView.ClearNodeSelection();

                foreach (PureComponents.TreeView.Node node in NavigationTreeView.Nodes)
                {
                    node.Select();
                    node.Expand();
                    SelectSubNodes(node);
                }

                NavigationTreeView.ResumeLayout(true);
                frmFlowChart.FlowChart.ResumeLayout(true);
                frmFlowChart.ResumeLayout(true);
                ResumeLayout(true);

                frmFlowChart.ZoomToVisible();
            }
        }