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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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
fromType
Type: Microsoft.SharePoint.SPFile.SPLockTypeThe current type of lock on the file.
toType
Type: Microsoft.SharePoint.SPFile.SPLockTypeThe type of lock to be placed on the file.
fromLockId
Type: System.StringThe identifier (ID) for the current lock.
toLockId
Type: System.StringThe ID for the new lock.
newTimeout
Type: System.TimeSpanThe desired duration for the new 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 .