Share via


IVsAsyncFileChangeEx.AdviseDirChangeAsync Method

Definition

Creates a subscription to changes for a directory.

public System.Threading.Tasks.Task<uint> AdviseDirChangeAsync (string directory, bool watchSubdirectories, Microsoft.VisualStudio.Shell.Interop.IVsFreeThreadedFileChangeEvents2 sink, System.Threading.CancellationToken cancellationToken = default);
abstract member AdviseDirChangeAsync : string * bool * Microsoft.VisualStudio.Shell.Interop.IVsFreeThreadedFileChangeEvents2 * System.Threading.CancellationToken -> System.Threading.Tasks.Task<uint32>
Public Function AdviseDirChangeAsync (directory As String, watchSubdirectories As Boolean, sink As IVsFreeThreadedFileChangeEvents2, Optional cancellationToken As CancellationToken = Nothing) As Task(Of UInteger)

Parameters

directory
String

The name of the directory to subscribe to.

watchSubdirectories
Boolean

If true, sink is notified of changes to file in directory and any of its subdirectories. If false, sink is notified of changes to files in directory only.

sink
IVsFreeThreadedFileChangeEvents2

The event sink.

cancellationToken
CancellationToken

The cancellation token.

Returns

A task that will complete once the subscription has been set up. The task's result will be the subscription cookie.

Remarks

This method is safe to access from any thread.

Applies to