/// <summary>Gets a list of the files in the directory represented by this file.</summary> /// <remarks> /// Gets a list of the files in the directory represented by this file. This /// list is then filtered through a FilenameFilter and the names of files /// with matching names are returned as an array of strings. Returns /// <code>null</code> /// if this file is not a directory. If /// <code>filter</code> /// is /// <code>null</code> /// then all filenames match. /// <p> /// The entries /// <code>.</code> /// and /// <code>..</code> /// representing the current and parent /// directories are not returned as part of the list. /// </remarks> /// <param name="filter"> /// the filter to match names against, may be /// <code>null</code> /// . /// </param> /// <returns> /// an array of files or /// <code>null</code> /// . /// </returns> public string[] list(java.io.FilenameFilter filter) { string[] filenames = list(); if (filter == null || filenames == null) { return(filenames); } java.util.List <string> result = new java.util.ArrayList <string>(filenames.Length); foreach (string filename in filenames) { if (filter.accept(this, filename)) { result.add(filename); } } return(result.toArray(new string[result.size()])); }