IAssetsAccessContext.GetAccessAsync(IEnumerable<String>, AssetsLockScope, CancellationToken, Int32) Methode

Definition

Erhalten Sie Zugriff auf eine Datei oder einen Ordner (der Ordner Zugriff wird rekursiv auf alle Elemente unter diesem Ordner angewendet).

Löst OperationCanceledException aus, wenn "Cancel" abgebrochen wird, wird accesslockyieldrequestexception ausgelöst, wenn der Kontext angefordert wird, um einen anderen wichtigen Workflow zu erhalten.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock> GetAccessAsync (System.Collections.Generic.IEnumerable<string> filePaths, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);
abstract member GetAccessAsync : seq<string> * Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope * System.Threading.CancellationToken * int -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock>
Public Function GetAccessAsync (filePaths As IEnumerable(Of String), Optional lockScope As AssetsLockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, Optional cancel As CancellationToken = Nothing, Optional timeout As Integer = -1) As Task(Of IAssetsLock)

Parameter

filePaths
IEnumerable<String>

die Auflistung von Zeichen folgen, die den Pfad zu einer Datei oder einem Ordner darstellen, kann absolut oder workspaceroot relative sein.

lockScope
AssetsLockScope

Sperrbereich

cancel
CancellationToken

Abbruch Token

timeout
Int32

maximale Wartezeit (in Millisekunden).

Gibt zurück

Task<IAssetsLock>

Das Zugriffs Sperr Objekt gibt NULL zurück, wenn das Timeout erreicht ist, wenn es abgebrochen wird.

Gilt für