Пример #1
0
        private void updateNode(TreeNode tn)
        {
            RenderableObjectInfo roi = (RenderableObjectInfo)tn.Tag;

            roi.LastSpotted = System.DateTime.Now;
            if (tn.Checked != roi.Renderable.IsOn)
            {
                tn.Checked = roi.Renderable.IsOn;
                //treeView1.BeginInvoke(new UpdateCheckStateNodeDelegate(this.UpdateCheckStateNode), new object[] {tn, roi.Renderable.IsOn});
            }

            if (roi.Renderable is WorldWind.Renderable.RenderableObjectList)
            {
                WorldWind.Renderable.RenderableObjectList rol = (WorldWind.Renderable.RenderableObjectList)roi.Renderable;
                for (int i = 0; i < rol.Count; i++)
                {
                    WorldWind.Renderable.RenderableObject childRo = (WorldWind.Renderable.RenderableObject)rol.ChildObjects[i];
                    string absolutePath = GetAbsoluteRenderableObjectPath(childRo);

                    TreeNode correctNode = (TreeNode)m_NodeHash[absolutePath];
                    if (correctNode == null)
                    {
                        correctNode = new TreeNode(childRo.Name);
                        RenderableObjectInfo curRoi = new RenderableObjectInfo();
                        curRoi.Renderable = childRo;
                        correctNode.Tag   = curRoi;

                        m_NodeHash.Add(absolutePath, correctNode);
                        treeView1.BeginInvoke(new UpdateChildNodeDelegate(this.UpdateChildNodeTree), new object[] { tn, correctNode });
                    }

                    updateNode(correctNode);
                }
            }
        }
Пример #2
0
        public void ScrollIntoView()
        {
            SWF.TreeView treeView = nodeProvider.TreeNode.TreeView;
            if (treeView == null)
            {
                Log.Error("TreeView.ScrollItem.ScrollIntoView: Parent TreeView is not set");
                return;
            }
            if (treeView.InvokeRequired)
            {
                treeView.BeginInvoke(new SWF.MethodInvoker(ScrollIntoView));
            }

            nodeProvider.TreeNode.EnsureVisible();
        }
Пример #3
0
 void ProjectBrowserTreeViewHandleCreated(object sender, EventArgs e)
 {
     System.Windows.Forms.TreeView treeView = (System.Windows.Forms.TreeView)sender;
     this.treeViewHandleCreatedAttached = false;
     treeView.HandleCreated            -= this.ProjectBrowserTreeViewHandleCreated;
     if (this.solutionToLoadWhenHandleIsCreated != null)
     {
         LoggingService.Debug("ProjectBrowser: Tree view handle created, will load " + this.solutionToLoadWhenHandleIsCreated.ToString() + ".");
         treeView.BeginInvoke(new Action <ISolution>(this.LoadSolution), this.solutionToLoadWhenHandleIsCreated);
         this.solutionToLoadWhenHandleIsCreated = null;
     }
     else
     {
         LoggingService.Debug("ProjectBrowser: Tree view handle created, no solution to load.");
     }
 }
Пример #4
0
 public TreeEntryService(TreeView tree, TextBox erroLogTextBox)
 {
     _helpers = new Helpers(String.Empty, erroLogTextBox);
     _tree = tree;
     try
     {
         _tree.BeginInvoke((MethodInvoker) delegate
         {
             _tree.Nodes.Clear();
         });
     }
     catch (Exception ex)
     {
         _helpers.WriteToLog(Resources.Error, ex.Message);
     }
 }
Пример #5
0
        public void Toggle()
        {
            SWF.TreeView treeView = nodeProvider.TreeNode.TreeView;
            if (treeView == null)
            {
                Log.Error("TreeView.Toggle.Invoke: Parent TreeView is not set");
                return;
            }
            if (!treeView.Enabled)
            {
                throw new ElementNotEnabledException();
            }
            if (treeView.InvokeRequired)
            {
                treeView.BeginInvoke(new SWF.MethodInvoker(Toggle));
            }

            nodeProvider.TreeNode.Checked = !nodeProvider.TreeNode.Checked;
        }
 public void Select()
 {
     SWF.TreeView treeView = nodeProvider.TreeNode.TreeView;
     if (treeView == null)
     {
         Log.Error("TreeView.SelectionItem.Select: Parent TreeView is not set");
         return;
     }
     if (!treeView.Enabled)
     {
         throw new ElementNotEnabledException();
     }
     if (treeView.InvokeRequired)
     {
         treeView.BeginInvoke(new SWF.MethodInvoker(Select));
         return;
     }
     treeView.SelectedNode = nodeProvider.TreeNode;
 }
Пример #7
0
 public void SetValue(string val)
 {
     SWF.TreeView treeView = nodeProvider.TreeNode.TreeView;
     if (treeView == null)
     {
         Log.Error("TreeView.Value.SetValue: Parent TreeView is not set");
         return;
     }
     if (!treeView.Enabled)
     {
         throw new ElementNotEnabledException();
     }
     if (treeView.InvokeRequired)
     {
         treeView.BeginInvoke(new SetValueDelegate(PerformSetValue),
                              new object [] { val });
         return;
     }
     PerformSetValue(val);
 }
Пример #8
0
        public void Collapse()
        {
            if (ExpandCollapseState == ExpandCollapseState.LeafNode)
            {
                throw new InvalidOperationException("LeafNode");
            }

            SWF.TreeView treeView = nodeProvider.TreeNode.TreeView;

            if (!treeView.Enabled)
            {
                throw new ElementNotEnabledException();
            }

            if (treeView != null && treeView.InvokeRequired)
            {
                treeView.BeginInvoke(new SWF.MethodInvoker(PerformCollapse));
                return;
            }

            PerformCollapse();
        }