Udostępnij za pośrednictwem


IFileSystemProvider.EnumerateDirectoryEntriesAsync Method

Definition

Enumerates the files and child directories of a directory.

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

Parameters

uri
Uri

The URI of the directory to read.

searchPattern
String

The search string to match against the names of files or child directories. 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 DirectoryEntryInfo instances.

Exceptions

uri is null.

The directory specified by uri does not exist.

The caller does not have the required permission.

Applies to