ICommandsService.SubscribeToRemoteCommandUpdateAsync 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.
Requests the VsctCommandId identifier associated with a VisualStudio.Extensibility command-related entity (command, menu, toolbar, etc.) and subscribes to notifications for changes of availability of such entity.
public System.Threading.Tasks.Task<IDisposable> SubscribeToRemoteCommandUpdateAsync (Microsoft.VisualStudio.RpcContracts.Commands.CommandType type, string id, IObserver<Microsoft.VisualStudio.RpcContracts.Commands.VsctCommandId> observer, System.Threading.CancellationToken cancellationToken);
abstract member SubscribeToRemoteCommandUpdateAsync : Microsoft.VisualStudio.RpcContracts.Commands.CommandType * string * IObserver<Microsoft.VisualStudio.RpcContracts.Commands.VsctCommandId> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<IDisposable>
Public Function SubscribeToRemoteCommandUpdateAsync (type As CommandType, id As String, observer As IObserver(Of VsctCommandId), cancellationToken As CancellationToken) As Task(Of IDisposable)
Parameters
- type
- CommandType
The type of Visual Studio command-related entity.
- id
- String
The unique identifier of a VisualStudio.Extensibility command-related entity (command, menu, toolbar, etc.).
- observer
- IObserver<VsctCommandId>
An IObservable<T> instance that will receive notifications of changes in availability of the requested entity. OnNext(T) will always be called at least once during or soon after the completion of the SubscribeToRemoteCommandUpdateAsync(CommandType, String, IObserver<VsctCommandId>, CancellationToken) async execution. OnNext(T) is called with an Undefined parameter if the requested entity is or becomes not available.
- cancellationToken
- CancellationToken
A CancellationToken to cancel the in-progress request.
Returns
An object that can be disposed when the subscription is no longer required.