Exemplo n.º 1
0
        /// <summary>
        /// Searchs for the node
        /// </summary>
        /// <param name="path"></param>
        /// <returns>The founded node, otherwise null will be returned</returns>
        public DirectoryNode Find(string path)
        {
            if (path.StartsWith(Directory))
            {
                path = path.Substring(Directory.Length).Trim('\\');
            }
            if (path == "")
            {
                return(this);
            }
            var    splits           = path.Split('\\');
            string currentDirectory = splits.First();

            if (Childrens.All(node => node.Directory != currentDirectory))
            {
                return(null);
            }
            return(this[currentDirectory].Find(path));
        }