다음을 통해 공유


ExtensionMethods.GetActiveTextViewAsync Method

Definition

Gets the active text view on the IDE at the time context was created.

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextViewSnapshot?> GetActiveTextViewAsync (this Microsoft.VisualStudio.Extensibility.IClientContext clientContext, System.Threading.CancellationToken cancellationToken);
static member GetActiveTextViewAsync : Microsoft.VisualStudio.Extensibility.IClientContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.ITextViewSnapshot>
<Extension()>
Public Function GetActiveTextViewAsync (clientContext As IClientContext, cancellationToken As CancellationToken) As Task(Of ITextViewSnapshot)

Parameters

clientContext
IClientContext

Client context to utilize.

cancellationToken
CancellationToken

Cancellation token to monitor.

Returns

an instance of ITextViewSnapshot if there is an active text view, otherwise null.

Applies to