AccessControlExtensions.GetAccessAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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);
static member GetAccessAsync : Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext * string * Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope * System.Threading.CancellationToken * int -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock>
<Extension()>
Public Function GetAccessAsync (context As IAssetsAccessContext, filePath As 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
- 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);
static member GetAccessAsync : Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessManager * Microsoft.VisualStudio.Workspace.AssetsControl.ContextPriority * seq<string> * Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode * Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope * System.Threading.CancellationToken * int -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock>
<Extension()>
Public Function GetAccessAsync (accessControl As IAssetsAccessManager, priority As ContextPriority, filePaths As IEnumerable(Of String), Optional sharingMode As SharingMode = Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode.Exclusive, 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
- 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);
static member GetAccessAsync : Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessManager * Microsoft.VisualStudio.Workspace.AssetsControl.ContextPriority * string * Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode * Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope * System.Threading.CancellationToken * int -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsLock>
<Extension()>
Public Function GetAccessAsync (accessControl As IAssetsAccessManager, priority As ContextPriority, filePath As String, Optional sharingMode As SharingMode = Microsoft.VisualStudio.Workspace.AssetsControl.SharingMode.Exclusive, 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
- 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