Exemple #1
0
        private void hwPreproTree_Expanded(object sender, TreeViewAdvEventArgs e)
        {
            PreproTreeNode ppNode = e.Node.Tag as PreproTreeNode;

            if (ppNode != null)
            {
                ppNode.DataNode.UIExpanded = e.Node.IsExpanded;
            }
        }
Exemple #2
0
        public TreePath GetPath(PreproTreeNode node)
        {
            var stack = new Stack <PreproTreeNode>();

            while (node != null)
            {
                stack.Push(node);
                node = node.Parent as PreproTreeNode;
            }
            return(new TreePath(stack.ToArray()));
        }
Exemple #3
0
 public TreePath GetPath(PreproTreeNode node)
 {
     {
     Stack<object> stack = new Stack<object>();
     while (node != null)
     {
       stack.Push(node);
       node = node.Parent as PreproTreeNode;
     }
     return new TreePath(stack.ToArray());
       }
 }
Exemple #4
0
        internal void ConvertPPNodeToTreeNode(PreproNode ppNode, Node treeNode)
        {
            if ( ppNode.UIVisible )
              {
            PreproTreeNode NewNode = new PreproTreeNode();

            NewNode.DataNode = ppNode;
            NewNode.Text = ppNode.Path;
            NewNode.Line = ppNode.LineCounter.ToString();
            NewNode.LineDelta = ppNode.LineDelta.ToString();

            treeNode.Nodes.Add(NewNode);
            hwPreproTree.Model = _model;

            var poot = hwPreproTree.FindNode(GetPath(NewNode));
            poot.IsExpanded = ppNode.UIExpanded;

            foreach (PreproNode ppChildNode in ppNode.Children)
            {
              ConvertPPNodeToTreeNode(ppChildNode, NewNode);
            }
              }
        }
Exemple #5
0
        void ConvertPPNodeToTreeNode(PreproNode ppNode, Node treeNode)
        {
            if (ppNode.UIVisible)
            {
                var newNode = new PreproTreeNode()
                {
                    DataNode  = ppNode,
                    Text      = ppNode.Path,
                    Line      = ppNode.LineCounter.ToString(),
                    LineDelta = ppNode.LineDelta.ToString(),
                };

                treeNode.Nodes.Add(newNode);
                hwPreproTree.Model = _model;

                var poot = hwPreproTree.FindNode(GetPath(newNode));
                poot.IsExpanded = ppNode.UIExpanded;

                foreach (PreproNode ppChildNode in ppNode.Children)
                {
                    ConvertPPNodeToTreeNode(ppChildNode, newNode);
                }
            }
        }