예제 #1
0
        private FileTree SelectDirectory(string[] path)
        {
            // make the top level directory selectable by passing an empty path
            //if ((path.Length == 0) || ((path.Length == 1) && (path[0].Length == 1) && (PathSeparators.Contains(path[0][0]))))
            if (path.Length == 0)
            {
                return(this);
            }

            FileTree sub = SubDirectories.First(subDir => subDir.Name == path[0]);

            if ((sub != null) && (path.Length > 1))
            {
                return(sub.SelectDirectory(path.Skip(1).ToArray()));
            }
            else
            {
                return(sub);
            }
        }