コード例 #1
0
        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));
            }
        }
コード例 #2
0
ファイル: Tree.cs プロジェクト: dmlogv/hr-rninform-xmlreader
        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);
        }