AccessControlExtensions.GetAccessAsync Method

Definition

Overloads

GetAccessAsync(IAssetsAccessContext, String, AssetsLockScope, CancellationToken, Int32)

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

Note: it will throw canceled exception if the scope CancelRequest becomes active (in addition the cancel token).

GetAccessAsync(IAssetsAccessManager, ContextPriority, IEnumerable<String>, SharingMode, AssetsLockScope, CancellationToken, Int32)

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

Note: it will throw canceled exception if the scope CacnelRequest becomes active (in addition the cancel token).

GetAccessAsync(IAssetsAccessManager, ContextPriority, String, SharingMode, AssetsLockScope, CancellationToken, Int32)

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

Note: it will throw canceled exception if the scope CacnelRequest becomes active (in addition the cancel token).

GetAccessAsync(IAssetsAccessContext, String, AssetsLockScope, CancellationToken, Int32)

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

Note: it will throw canceled exception if the scope CancelRequest becomes active (in addition the cancel token).

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock> GetAccessAsync (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext context, string filePath, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);
public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock?> GetAccessAsync (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext context, string filePath, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);

Parameters

context
IAssetsAccessContext

asset access context

filePath
String

the 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

GetAccessAsync(IAssetsAccessManager, ContextPriority, IEnumerable<String>, SharingMode, AssetsLockScope, CancellationToken, Int32)

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

Note: it will throw canceled exception if the scope CacnelRequest becomes active (in addition the cancel token).

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock> GetAccessAsync (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessManager accessControl, Microsoft.VisualStudio.Workspace.AssetsControl.ContextPriority priority, System.Collections.Generic.IEnumerable<string> filePaths, Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode sharingMode = Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode.Exclusive, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);
public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock?> GetAccessAsync (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessManager accessControl, Microsoft.VisualStudio.Workspace.AssetsControl.ContextPriority priority, System.Collections.Generic.IEnumerable<string> filePaths, Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode sharingMode = Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode.Exclusive, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);

Parameters

accessControl
IAssetsAccessManager

the access control service

priority
ContextPriority

the priority of the work

filePaths
IEnumerable<String>

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

sharingMode
SharingMode

sharing mode

lockScope
AssetsLockScope

children lock scope

cancel
CancellationToken

cancellation token

timeout
Int32

maximum time to wait (in milliseconds).

Returns

the access lock object, null if timeout expired

Applies to

GetAccessAsync(IAssetsAccessManager, ContextPriority, String, SharingMode, AssetsLockScope, CancellationToken, Int32)

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

Note: it will throw canceled exception if the scope CacnelRequest becomes active (in addition the cancel token).

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock> GetAccessAsync (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessManager accessControl, Microsoft.VisualStudio.Workspace.AssetsControl.ContextPriority priority, string filePath, Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode sharingMode = Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode.Exclusive, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);
public static System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock?> GetAccessAsync (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessManager accessControl, Microsoft.VisualStudio.Workspace.AssetsControl.ContextPriority priority, string filePath, Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode sharingMode = Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode.Exclusive, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default, int timeout = -1);

Parameters

accessControl
IAssetsAccessManager

the access control service

priority
ContextPriority

the priority of the work

filePath
String

the path to file or folder, can be absolute or WorkspaceRoot relative

sharingMode
SharingMode

sharing mode

lockScope
AssetsLockScope

children lock scope

cancel
CancellationToken

cancellation token

timeout
Int32

maximum time to wait (in milliseconds).

Returns

the access lock object

Applies to