public static FileInfo[] listFiles(FileInfo dir, FilenameFilter filter)
        {
            String[] fileNames = Directory.GetFileSystemEntries(dir.FullName);

            if (fileNames == null)
            {
                return(null);
            }

            System.Collections.ArrayList filteredFiles = new System.Collections.ArrayList();
            for (int i = 0; i < fileNames.Length; i++)
            {
                if ((filter == null) || filter.accept(dir, fileNames[i]))
                {
                    filteredFiles.Add(new FileInfo(dir.FullName + "\\" + fileNames[i]));
                }
            }

            return((FileInfo[])(SupportClass.ICollectionSupport.ToArray(filteredFiles, new FileInfo[0])));
        }
Exemple #2
0
		public static FileInfo[] listFiles(FileInfo dir, FilenameFilter filter)
		{
			String[] fileNames = Directory.GetFileSystemEntries(dir.FullName);
			
			if (fileNames == null)
			{
				return null;
			}
			
			System.Collections.ArrayList filteredFiles = new System.Collections.ArrayList();
			for (int i = 0; i < fileNames.Length; i++)
			{
				if ((filter == null) || filter.accept(dir, fileNames[i]))
				{
					filteredFiles.Add(new FileInfo(dir.FullName + "\\" + fileNames[i]));
				}
			}
			
			return (FileInfo[]) (SupportClass.ICollectionSupport.ToArray(filteredFiles, new FileInfo[0]));
		}