다음을 통해 공유


IOpenDocumentEnumeratorFactory2.GetEnumeratorFavoringOpenDocuments Method

Definition

Get an enumerator for all open documents.

public Microsoft.VisualStudio.Shell.Internal.FileEnumerationService.IFileEntityAsyncEnumerator GetEnumeratorFavoringOpenDocuments (Microsoft.VisualStudio.Shell.Internal.FileEnumerationService.IFileEntityAsyncEnumerator fileEntityEnumerator, Action<System.Collections.Generic.Dictionary<string,object>>? telemetryCallBack = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEnumeratorFavoringOpenDocuments : Microsoft.VisualStudio.Shell.Internal.FileEnumerationService.IFileEntityAsyncEnumerator * Action<System.Collections.Generic.Dictionary<string, obj>> * System.Threading.CancellationToken -> Microsoft.VisualStudio.Shell.Internal.FileEnumerationService.IFileEntityAsyncEnumerator
Public Function GetEnumeratorFavoringOpenDocuments (fileEntityEnumerator As IFileEntityAsyncEnumerator, Optional telemetryCallBack As Action(Of Dictionary(Of String, Object)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IFileEntityAsyncEnumerator

Parameters

fileEntityEnumerator
IFileEntityAsyncEnumerator

Defines an enumerator where opened document must be merged to.

telemetryCallBack
Action<Dictionary<String,Object>>

(optional) An optional method called when the result is completed. Its arguments provide health and performance telemetry.

cancellationToken
CancellationToken

(optional) Cancellation token that can cancel IsInEnumerationAsync(FileEntity) and MoveNextAsync().

Returns

Returns an enumerator to get the next discovered file asynchronously.

Remarks

This enumerates everything in fileEntityEnumerator but return all the open documents first, when they are part of the given fileEntityEnumerator.

The current document, if there is one and it is eligible, will always be first.

Applies to