Convert Match to Treenode

33 views
Skip to first unread message

Chris Anders

unread,
Jan 30, 2015, 10:56:04 AM1/30/15
to eto-...@googlegroups.com
Hi,

ive tried to convert a match into a TreeNode to display all matches in a Treeview, but it cames at the commented line to an StackOvrFlowException.
What do i wrong?

private TreeNode MatchToNode(TreeNode parent, Match m)
       
{
           
foreach (var ma in m.Matches)
           
{
               
var t = new TreeNode();
                t
.Text = ma.Name;
               
var vn = new TreeNode(ma.StringValue);
                t
.Nodes.Add(vn);

               
//t.Nodes.Add(MatchToNode(t, m));

                parent
.Nodes.Add(t);
           
}

           
return parent;
       
}


Curtis Wensley

unread,
Jan 30, 2015, 11:24:13 AM1/30/15
to eto-...@googlegroups.com

You probably meant to pass 'ma' to the MatchToNode on that line, not 'm'.

Hope this helps!

Curtis.

Chris Anders

unread,
Jan 30, 2015, 11:38:47 AM1/30/15
to eto-...@googlegroups.com
thanks but now the ui is blocked

Curtis Wensley

unread,
Jan 30, 2015, 11:41:54 AM1/30/15
to eto-...@googlegroups.com
Sorry, I'm not sure what you mean about the UI being blocked.

I'm not even sure what UI toolkit you're using. (;

Cheers,
Curtis.

Chris Anders

unread,
Jan 30, 2015, 11:46:06 AM1/30/15
to eto-...@googlegroups.com
i use winforms

the program make absolut noting, i cant do anything when i convert to Treenode


Am Freitag, 30. Januar 2015 16:56:04 UTC+1 schrieb Chris Anders:

Curtis Wensley

unread,
Jan 30, 2015, 11:53:37 AM1/30/15
to eto-...@googlegroups.com

Hm, well it doesn't sound like a problem in this code or in Eto.Parse..  it might help if you debug your code to see what is going wrong.  For example, what tree nodes are being created, etc.  Also, you could try to make a TreeView with manually-created nodes to see if it is this code or your winforms code that is the problem.

Hope this helps!
Curtis.

Chris Anders

unread,
Jan 30, 2015, 11:58:31 AM1/30/15
to eto-...@googlegroups.com
the code produces the first node, then it block

Chris Anders

unread,
Jan 30, 2015, 12:34:47 PM1/30/15
to eto-...@googlegroups.com
it is fixed now


Am Freitag, 30. Januar 2015 16:56:04 UTC+1 schrieb Chris Anders:
Reply all
Reply to author
Forward
0 new messages