Exemplo n.º 1
0
 public void selectNode(TreeNode tree)
 {
     if (tree.Name == "CGroup" || tree.Name == "CCircle" || tree.Name == "CSegment" || tree.Name == "CRectangle" ||
         tree.Name == "CTriangle" || tree.Text == "group")
     {
         foreach (TreeNode tr in tree.Nodes)
         {
             selectNode(tr);
         }
     }
     else
     {
         try {
             int k = Convert.ToInt32(tree.Name);
             if (tree.Parent.Parent.Text == "group")
             {
                 CGroup g = (CGroup)arr[Convert.ToInt32(tree.Parent.Parent.Name)];
                 g.getObj(k).select();
             }
             else
             {
                 arr[k].select();
             }
         }
         catch { }
     }
 }
Exemplo n.º 2
0
 public void processNode(TreeNode tree, CPoint point, int k)
 {
     if (tree == null || tree.Nodes[point.classname()] == null)
     {
         tree.Nodes.Add(point.classname(), point.classname());
     }
     if (point.IsA("CGroup") == true)
     {
         tree.Nodes[point.classname()].Nodes.Add(k.ToString(), "group");
         CGroup g = (CGroup)point;
         for (int i = 0; i < g.getCount(); i++)
         {
             processNode(tree.Nodes["CGroup"].Nodes[k.ToString()], g.getObj(i), i);
         }
     }
     else
     {
         tree.Nodes[point.classname()].Nodes.Add(k.ToString(), $"({point.getX()}, {point.getY()})");
     }
     if (point.IsObjectSelected() == true)
     {
         myTree.SelectedNode = tree.Nodes[point.classname()].LastNode;
     }
 }