Recursion with delagates
I wish to write following code but I get the error that variable is not inialized.
delegatevoidRecur(TreeNodeCollection nodes);publicvoid ShowKeywords(string message){
List<TreeNode> list =newList<TreeNode>();Recur recur =delegate(TreeNodeCollection nodes){
foreach (TreeNode nodein nodes){
list.Add(node);
recur(node.Nodes);
}
};
recur(treeView1.Nodes);
--
error is
Error 12 Use of unassigned local variable 'recur'
It is possible to modify
Recur recur =delegate(TreeNodeCollection nodes)
to
Recur recur =null;
recur =delegate(TreeNodeCollection nodes)
But I think it worth to modify C# a bit to make first code possible.

