private void importXml(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { RNUObj RNUObj = RNUObj.Instance(); RNUObj = Xml.ImportXml <RNUObj>(openFileDialog.FileName); treeView.Nodes.Clear(); treeView.Nodes.Add(Tree.PopulateTreeRoot(RNUObj)); } }
public static TreeNode PopulateTreeRoot(RNUObj RNUObj) { var TreeNode = new TreeNode(); foreach (var Obj in getRNUObjStorage(RNUObj.Instance().InnerStorage)) { String CurrentKey = Obj.Key; List <IContainer> CurrentValue = Obj.Value; TreeNode CurrentNode = TreeNode.Nodes.Add(CurrentKey); CurrentNode.Tag = CurrentValue; CurrentNode.Nodes.AddRange(PopulateTreeNodes(CurrentValue).ToArray()); } return(TreeNode); }