IWorkspace4.GetFilesAsync(String, Boolean, String, CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a set of files within the workspace.
public System.Collections.Generic.IAsyncEnumerable<string> GetFilesAsync (string path, bool recursive, string searchPattern, System.Threading.CancellationToken cancellationToken = default);
abstract member GetFilesAsync : string * bool * string * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<string>
Public Function GetFilesAsync (path As String, recursive As Boolean, searchPattern As String, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of String)
Parameters
- path
- String
The folder within the workspace that should be searched for files. May be absolute, or relative to the Location. An empty path is interpreted as the workspace root.
- recursive
- Boolean
true
to return files in path
and its sub-folders;
false
to return only files found in the immediate folder.
- searchPattern
- String
The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters but doesn't support regular expressions.
- cancellationToken
- CancellationToken
A token that cancels the query.
Returns
An enumerator for files found matching the searchPattern
.