다음을 통해 공유


IFileSystemProvider.WatchFileAsync(Uri, CancellationToken) Method

Definition

Starts watching a file for changes. A DirectoryEntryChanged event occurs when the file specified by uri is created, deleted, or modified.

public:
 System::Threading::Tasks::ValueTask<Microsoft::VisualStudio::RpcContracts::FileSystem::WatchResult ^> WatchFileAsync(Uri ^ uri, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.ValueTask<Microsoft.VisualStudio.RpcContracts.FileSystem.WatchResult> WatchFileAsync (Uri uri, System.Threading.CancellationToken cancellationToken);
abstract member WatchFileAsync : Uri * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.VisualStudio.RpcContracts.FileSystem.WatchResult>
Public Function WatchFileAsync (uri As Uri, cancellationToken As CancellationToken) As ValueTask(Of WatchResult)

Parameters

uri
Uri

The file to be watched.

cancellationToken
CancellationToken

The cancellation token.

Returns

An object which can be passed to UnwatchAsync(WatchResult, CancellationToken) to stop watching the file.

Exceptions

uri is null.

Applies to