TeamFoundationLockingService.AcquireLock Method (TeamFoundationRequestContext, TeamFoundationLockMode, String)
Gets a cross-process lock on the given resource.
Namespace: Microsoft.TeamFoundation.Framework.Server
Assembly: Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)
Syntax
'Declaration
Public Function AcquireLock ( _
requestContext As TeamFoundationRequestContext, _
lockMode As TeamFoundationLockMode, _
resource As String _
) As TeamFoundationLock
public TeamFoundationLock AcquireLock(
TeamFoundationRequestContext requestContext,
TeamFoundationLockMode lockMode,
string resource
)
public:
TeamFoundationLock^ AcquireLock(
TeamFoundationRequestContext^ requestContext,
TeamFoundationLockMode lockMode,
String^ resource
)
member AcquireLock :
requestContext:TeamFoundationRequestContext *
lockMode:TeamFoundationLockMode *
resource:string -> TeamFoundationLock
public function AcquireLock(
requestContext : TeamFoundationRequestContext,
lockMode : TeamFoundationLockMode,
resource : String
) : TeamFoundationLock
Parameters
requestContext
Type: Microsoft.TeamFoundation.Framework.Server.TeamFoundationRequestContextThe context for this request.
lockMode
Type: Microsoft.TeamFoundation.Framework.Server.TeamFoundationLockModeThe lock mode used to acquire the lock.
resource
Type: System.StringThe resource to lock on.
Return Value
Type: Microsoft.TeamFoundation.Framework.Server.TeamFoundationLock
The lock on this resource. This lock should be disposed when it must be released.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.