語言

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

登錄檔鑰匙可以留意變化。

watchSubtree
Boolean

true 同時觀察鑰匙的下降鍵; false 只看這把鑰匙,沒有後代。

change
RegistryChangeNotificationFilters

顯示需要注意的變化類型。

cancellationToken
CancellationToken

一個可以取消的標記,用來釋放資源不再監控變更,並完成已取消的任務。

傳回

當登錄檔金鑰變更、句柄關閉或取消時完成的任務。

適用於