private void addNode(TreeNodeCollection nodes, string name, FileFindResult result) { int image = 0; if (result.Type == FileFindResultType.File) { image = 4; } if (result.Type == FileFindResultType.Project) { image = 5; } var node = nodes.Add(name); node.ImageIndex = image; node.SelectedImageIndex = image; node.Tag = result; if (isDirectory(result)) { node.Nodes.Add(""); } }
private static bool isDirectory(FileFindResult x) { return(x.Type == FileFindResultType.Directory || x.Type == FileFindResultType.DirectoryInProject); }