AwaitExtensions.WaitForChangeAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個任務,當指定的登錄檔金鑰變更時完成。
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 只看這把鑰匙,沒有後代。
顯示需要注意的變化類型。
- cancellationToken
- CancellationToken
一個可以取消的標記,用來釋放資源不再監控變更,並完成已取消的任務。
傳回
當登錄檔金鑰變更、句柄關閉或取消時完成的任務。