Partager via


IEditorHostService.CreateActiveTextViewAsync Method

Definition

Creates a new ITextViewSnapshot from the properties contained in clientContext.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextViewSnapshot?> CreateActiveTextViewAsync (System.Collections.Generic.IReadOnlyDictionary<string,object?> clientContext, System.Threading.CancellationToken cancellationToken);
abstract member CreateActiveTextViewAsync : System.Collections.Generic.IReadOnlyDictionary<string, obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextViewSnapshot>
Public Function CreateActiveTextViewAsync (clientContext As IReadOnlyDictionary(Of String, Object), cancellationToken As CancellationToken) As Task(Of ITextViewSnapshot)

Parameters

clientContext
IReadOnlyDictionary<String,Object>

UI properties, including document version (Microsoft.VisualStudio.Extensibility.Framework.IClientContext as dictionary).

cancellationToken
CancellationToken

Cancels the creation action.

Returns

A ITextViewSnapshot thick object that can be used to interact with the editor.

Remarks

This overload is meant primarily for creating ITextViewSnapshots based on properties captured during command invocation.

Applies to