IVsAsyncFileChangeEx.AdviseFileChangeAsync Method

Definition

Creates a subscription to changes for a single file.

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

Parameters

filename
String

The name of the file to subscribe to.

filter
_VSFILECHANGEFLAGS

The flags describing the changes to be notified of.

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