Compartir a través de


WorkspaceHelper.GetFirstFileContextsAsync<T> Method

Definition

Get the first available context for a workspace context

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.FileContext> GetFirstFileContextsAsync<T> (this Microsoft.VisualStudio.Workspace.IWorkspace workspace, string filePath, T context, System.Collections.Generic.IEnumerable<Guid> fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.FileContext?> GetFirstFileContextsAsync<T> (this Microsoft.VisualStudio.Workspace.IWorkspace workspace, string filePath, T context, System.Collections.Generic.IEnumerable<Guid>? fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
static member GetFirstFileContextsAsync : Microsoft.VisualStudio.Workspace.IWorkspace * string * 'T * seq<Guid> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.FileContext>
<Extension()>
Public Function GetFirstFileContextsAsync(Of T) (workspace As IWorkspace, filePath As String, context As T, fileContextTypes As IEnumerable(Of Guid), Optional cancellationToken As CancellationToken = Nothing) As Task(Of FileContext)

Type Parameters

T

Type of the workspace context

Parameters

workspace
IWorkspace

The workspace instance

filePath
String

The workspace file path

context
T

The instance of the workspace context

fileContextTypes
IEnumerable<Guid>

Optional list of file context types

cancellationToken
CancellationToken

A cancellation token.

Returns

The first available file context

Applies to