AwaitExtensions.WaitForChangeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a Task that completes when the specified registry key changes.
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
Parameters
- registryKey
- RegistryKey
The registry key to watch for changes.
- watchSubtree
- Boolean
true
to watch the keys descendent keys as well; false
to watch only this key without descendents.
Indicates the kinds of changes to watch for.
- cancellationToken
- CancellationToken
A token that may be canceled to release the resources from watching for changes and complete the returned Task as canceled.
Returns
A task that completes when the registry key changes, the handle is closed, or upon cancellation.