Freigeben über


WorkspaceHelper.GetFirstFileContextActionAsync<T> Method

Definition

Get the first available action for a workspace context

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

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 action (or null)

Applies to