WorkspaceHelper.GetFirstFileContextActionAsync<T> Method
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.
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)
- T
Type of the workspace context
- 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.
The first available action (or null)