Compartir a través de


IWorkspace.GetFileContextsAsync Method

Definition

Overloads

GetFileContextsAsync(String, IEnumerable<Guid>, CancellationToken)

Gets the file contexts associated with the specified workspace location.

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

Get file contexts for a workspace context

GetFileContextsAsync(String, IEnumerable<Guid>, CancellationToken)

Gets the file contexts associated with the specified workspace location.

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

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>

The collection of file context types of interest of the caller.

cancellationToken
CancellationToken

A cancellation token.

Returns

The collection of applicable file context providers.

Applies to

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

Get file contexts for a workspace context

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextProvider,Microsoft.VisualStudio.Workspace.IFileContextProviderMetadata>,Microsoft.VisualStudio.Workspace.FileContext>>> GetFileContextsAsync<T> (string path, T context, System.Collections.Generic.IEnumerable<Guid> fileContextTypes, System.Threading.CancellationToken cancellationToken = default);
abstract member GetFileContextsAsync : string * 'T * seq<Guid> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<System.Linq.IGrouping<Lazy<Microsoft.VisualStudio.Workspace.IFileContextProvider, Microsoft.VisualStudio.Workspace.IFileContextProviderMetadata>, Microsoft.VisualStudio.Workspace.FileContext>>>
Public Function GetFileContextsAsync(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 IFileContextProvider, IFileContextProviderMetadata), FileContext)))

Type Parameters

T

Type of the workspace context being passed

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

Instance of the workspace context

fileContextTypes
IEnumerable<Guid>

The collection of file context types of interest to the caller.

cancellationToken
CancellationToken

A cancellation token.

Returns

The collection of applicable file context providers.

Applies to