다음을 통해 공유


IWorkspace.GetFileContextActionsAsync Method

Definition

Overloads

GetFileContextActionsAsync(String, IEnumerable<Guid>, CancellationToken)

Gets the actions available at the specified path.

GetFileContextActionsAsync<T>(String, T, IEnumerable<Guid>, CancellationToken)

Gets the actions available on a workspace context

GetFileContextActionsAsync(String, IEnumerable<Guid>, CancellationToken)

Gets the actions available at the specified path.

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextActionProvider,Microsoft.VisualStudio.Workspace.IFileContextActionProviderMetadata>,Microsoft.VisualStudio.Workspace.IFileContextAction>>> GetFileContextActionsAsync (string path, System.Collections.Generic.IEnumerable<Guid> fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextActionProvider,Microsoft.VisualStudio.Workspace.IFileContextActionProviderMetadata>,Microsoft.VisualStudio.Workspace.IFileContextAction>>> GetFileContextActionsAsync (string path, System.Collections.Generic.IEnumerable<Guid>? fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
abstract member GetFileContextActionsAsync : string * seq<Guid> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextActionProvider, Microsoft.VisualStudio.Workspace.IFileContextActionProviderMetadata>, Microsoft.VisualStudio.Workspace.IFileContextAction>>>
Public Function GetFileContextActionsAsync (path As String, fileContextTypes As IEnumerable(Of Guid), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyList(Of IGrouping(Of Lazy(Of IFileContextActionProvider, IFileContextActionProviderMetadata), IFileContextAction)))

Parameters

path
String

The path to the file or folder for which a context is required. May be absolute or relative to workspace root Location.

fileContextTypes
IEnumerable<Guid>

Optional list of file context types

cancellationToken
CancellationToken

A cancellation token.

Returns

A task whose result is a collection of actions that can be taken on the specified path. The collection should never be null, but it may be empty.

Applies to

GetFileContextActionsAsync<T>(String, T, IEnumerable<Guid>, CancellationToken)

Gets the actions available on a workspace context

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextActionProvider,Microsoft.VisualStudio.Workspace.IFileContextActionProviderMetadata>,Microsoft.VisualStudio.Workspace.IFileContextAction>>> GetFileContextActionsAsync<T> (string path, T context, System.Collections.Generic.IEnumerable<Guid> fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextActionProvider,Microsoft.VisualStudio.Workspace.IFileContextActionProviderMetadata>,Microsoft.VisualStudio.Workspace.IFileContextAction>>> GetFileContextActionsAsync<T> (string path, T context, System.Collections.Generic.IEnumerable<Guid>? fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
abstract member GetFileContextActionsAsync : string * 'T * seq<Guid> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextActionProvider, Microsoft.VisualStudio.Workspace.IFileContextActionProviderMetadata>, Microsoft.VisualStudio.Workspace.IFileContextAction>>>
Public Function GetFileContextActionsAsync(Of T) (path As String, context As T, fileContextTypes As IEnumerable(Of Guid), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyList(Of IGrouping(Of Lazy(Of IFileContextActionProvider, IFileContextActionProviderMetadata), IFileContextAction)))

Type Parameters

T

Type of the workspace context

Parameters

path
String

The path to the file or folder for which a context is required. May be absolute or relative to workspace root Location.

context
T

The instance of the workspace context

fileContextTypes
IEnumerable<Guid>

Optional list of file context types

cancellationToken
CancellationToken

A cancellation token.

Returns

Actions available

Applies to