Exemplo n.º 1
0
        //internal: share use function for GetDirectories/Files
        private FTPdirectory GetFileOrDir(FTPfileInfo.DirectoryEntryTypes type, string ext)
        {
            FTPdirectory result = new FTPdirectory();

            foreach (FTPfileInfo fi in this)
            {
                if (fi.FileType == type)
                {
                    if (ext == "")
                    {
                        result.Add(fi);
                    }
                    else if (ext == fi.Extension)
                    {
                        result.Add(fi);
                    }
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        //<summary>
        //Returns a list of only subdirectories
        //</summary>
        //<returns>FTPDirectory list</returns>
        //<remarks></remarks>
        //public FTPdirectory GetDirectories()
        //{
        //    //return this.GetFileOrDir(FTPfileInfo.DirectoryEntryTypes.Directory);
        //}

        // internal: share use function for GetDirectories/Files
        private FTPdirectory GetFileOrDir(FTPfileInfo.DirectoryEntryTypes type, [System.Runtime.InteropServices.Optional] string ext)
        {
            FTPdirectory result = new FTPdirectory();

            foreach (FTPfileInfo fi in this)
            {
                if (fi.FileType == type)
                {
                    if (string.IsNullOrEmpty(ext))
                    {
                        result.Add(fi);
                    }
                    else if (ext == fi.Extension)
                    {
                        result.Add(fi);
                    }
                }
            }

            return(result);
        }