AwaitExtensions.WaitForChangeAsync 方法

定义

返回一个任务,该任务在指定的注册表项更改时完成。

public static System.Threading.Tasks.Task WaitForChangeAsync (this Microsoft.Win32.RegistryKey registryKey, bool watchSubtree = true, Microsoft.VisualStudio.Threading.RegistryChangeNotificationFilters change = Microsoft.VisualStudio.Threading.RegistryChangeNotificationFilters.Subkey | Microsoft.VisualStudio.Threading.RegistryChangeNotificationFilters.Value, System.Threading.CancellationToken cancellationToken = default);
static member WaitForChangeAsync : Microsoft.Win32.RegistryKey * bool * Microsoft.VisualStudio.Threading.RegistryChangeNotificationFilters * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WaitForChangeAsync (registryKey As RegistryKey, Optional watchSubtree As Boolean = true, Optional change As RegistryChangeNotificationFilters = Microsoft.VisualStudio.Threading.RegistryChangeNotificationFilters.Subkey | Microsoft.VisualStudio.Threading.RegistryChangeNotificationFilters.Value, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

registryKey
RegistryKey

要watch更改的注册表项。

watchSubtree
Boolean

true若要watch键后代键,则为 ;false如果只watch此键,则不为后代键。

change
RegistryChangeNotificationFilters

指示watch的更改类型。

cancellationToken
CancellationToken

一个令牌,可以取消以释放资源以监视更改并完成已取消返回的任务。

返回

当注册表项更改、句柄关闭或取消时完成的任务。

适用于