SPFile.ConvertLock method

Converts an existing lock on the file to a new type of lock.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub ConvertLock ( _
    fromType As SPFile.SPLockType, _
    toType As SPFile.SPLockType, _
    fromLockId As String, _
    toLockId As String, _
    newTimeout As TimeSpan _
)
'Usage
Dim instance As SPFile
Dim fromType As SPFile.SPLockType
Dim toType As SPFile.SPLockType
Dim fromLockId As String
Dim toLockId As String
Dim newTimeout As TimeSpan

instance.ConvertLock(fromType, toType, _
    fromLockId, toLockId, newTimeout)
public void ConvertLock(
    SPFile.SPLockType fromType,
    SPFile.SPLockType toType,
    string fromLockId,
    string toLockId,
    TimeSpan newTimeout
)

Parameters

  • fromLockId
    Type: System.String

    The identifier (ID) for the current lock.

Exceptions

Exception Condition
SPFileLockException

The value of the fromType or toType parameter is None.

SPException

An error occurred while converting the lock.

Remarks

Neither the value of the fromType parameter nor the value of the toType parameter should be null .

See also

Reference

SPFile class

SPFile members

Microsoft.SharePoint namespace

SPFile.SPLockType

LockedByUser