Exemplo n.º 1
0
        public void BeforeExpand(TreeNode node)
        {
            if (node.Nodes.Count != 1 && node.Nodes[0].Tag != null)
            {
                return;
            }
            var result = (FileFindResult)node.Tag;

            if (result.Type == FileFindResultType.Directory)
            {
                addSubNodes(
                    _cache.GetFilesInDirectory(result.File + Path.DirectorySeparatorChar.ToString()).ToList(),
                    node.Nodes);
            }
            if (result.Type == FileFindResultType.DirectoryInProject)
            {
                addSubNodes(
                    _cache.GetFilesInProject(
                        result.File + Path.DirectorySeparatorChar.ToString(),
                        result.ProjectPath).ToList(),
                    node.Nodes);
            }
        }