Freigeben über


IContextRuleMonitorService.RegisterContextRuleAsync Method

Definition

Creates a new Context rule that is monitored and requests that a ContextRuleStateChanged event be raised when the rule changes state, such as becoming active.

public:
 System::Threading::Tasks::ValueTask RegisterContextRuleAsync(Microsoft::VisualStudio::RpcContracts::ContextRuleMonitor::ContextRuleMetadata ^ ruleMetadata, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.ValueTask RegisterContextRuleAsync (Microsoft.VisualStudio.RpcContracts.ContextRuleMonitor.ContextRuleMetadata ruleMetadata, System.Threading.CancellationToken cancellationToken);
abstract member RegisterContextRuleAsync : Microsoft.VisualStudio.RpcContracts.ContextRuleMonitor.ContextRuleMetadata * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Function RegisterContextRuleAsync (ruleMetadata As ContextRuleMetadata, cancellationToken As CancellationToken) As ValueTask

Parameters

ruleMetadata
ContextRuleMetadata

The data object representing the context rule to monitor.

cancellationToken
CancellationToken

A cancellation token to cancel the in-progress invocation.

Returns

A ValueTask representing the asynchronous operation.

Applies to