Partager via


IFileSystemProvider.EnumerateFilesAsync Method

Definition

Enumerates the files of a directory.

public:
 System::Collections::Generic::IAsyncEnumerable<Microsoft::VisualStudio::RpcContracts::FileSystem::FileInfo ^> ^ EnumerateFilesAsync(Uri ^ uri, System::String ^ searchPattern, System::IO::SearchOption searchOption, System::Threading::CancellationToken cancellationToken);
public System.Collections.Generic.IAsyncEnumerable<Microsoft.VisualStudio.RpcContracts.FileSystem.FileInfo> EnumerateFilesAsync (Uri uri, string searchPattern, System.IO.SearchOption searchOption, System.Threading.CancellationToken cancellationToken);
abstract member EnumerateFilesAsync : Uri * string * System.IO.SearchOption * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.VisualStudio.RpcContracts.FileSystem.FileInfo>
Public Function EnumerateFilesAsync (uri As Uri, searchPattern As String, searchOption As SearchOption, cancellationToken As CancellationToken) As IAsyncEnumerable(Of FileInfo)

Parameters

uri
Uri

The URI of the directory to read.

searchPattern
String

The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.

searchOption
SearchOption

Specifies whether to search only the directory specified by uri, or directory specified by uri and all of its subdirectories.

cancellationToken
CancellationToken

The cancellation token.

Returns

A collection of FileInfo instances.

Exceptions

uri is null.

The directory specified by uri does not exist.

The caller does not have the required permission.

Applies to