Ejemplo n.º 1
0
        /// <summary>
        /// Find a folder with the specified PATH either at this level or beneath us
        /// </summary>
        /// <param name="folderID"></param>
        /// <returns></returns>
        public FileSystemFolder FindFolderByPath(string path)
        {
            // Are we the folder being looked for?
            if (String.Compare(this.FullPath, path, true) == 0)
            {
                return(this);
            }

            // No - ok check our children then
            foreach (FileSystemFolder subFolder in _listFolders)
            {
                FileSystemFolder returnFolder = subFolder.FindFolderByPath(path);
                if (returnFolder != null)
                {
                    return(returnFolder);
                }
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Find a folder with the specified ID either at this level or beneath us
        /// </summary>
        /// <param name="folderID"></param>
        /// <returns></returns>
        public FileSystemFolder FindFolder(int folderID)
        {
            // Are we the folder being looked for?
            if (this.FolderID == folderID)
            {
                return(this);
            }

            // No - ok check our children then
            foreach (FileSystemFolder subFolder in _listFolders)
            {
                FileSystemFolder returnFolder = subFolder.FindFolder(folderID);
                if (returnFolder != null)
                {
                    return(returnFolder);
                }
            }

            return(null);
        }