private void InsertFiles(TreeNode parentNode, NameSpaceDirectory folder) { var files = folder.Files.Where(x => x.Name.EndsWith(".img")).ToDictionary(x => x.Name, x => x); foreach (var kvp in files) { var name = kvp.Key; var node = new WZTreeNode(); node.Name = name; node.Text = name; node.Tag = kvp.Value; kvp.Value.TreeNode = node; node.SetNotLoaded(); parentNode.Nodes.Add(node); } }
private void InsertFiles(TreeNode parentNode, NameSpaceDirectory folder) { var files = folder.Files.Where(x => x.Name.EndsWith(".img")).OrderBy(x => x.Name); foreach (var file in files) { var name = file.Name; var node = new WZTreeNode(); node.Name = name; node.Text = name; node.Tag = file; node.SetNotLoaded(); parentNode.Nodes.Add(node); } parentNode.ToolTipText = $"Subnodes: {parentNode.Nodes.Count}"; }