Share via


IAssetsAccessContext.GetAccessAsync Method

Definition

Get Access to a file or folder (folder access will apply to all items under that folder recursively).

Throws OperationCanceledException if "cancel" is canceled Throws AccessLockYieldRequestException if context is requested to yield to other more important workflow

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);
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)

Parameters

filePaths
IEnumerable<String>

the collection of strings representing path to file or folder, can be absolute or WorkspaceRoot relative

lockScope
AssetsLockScope

lock scope

cancel
CancellationToken

cancellation token

timeout
Int32

maximum time to wait (in milliseconds).

Returns

the access lock object, will return null if timeout reached, will throw if canceled

Applies to