DavItem.LockAsync Method

Namespace:
Weavy.Web.WebDAV
Assembly:
Weavy.Web.dll

LockAsync(LockLevel, bool, TimeSpan?, string)

Locks this item.

WebDAV engine passes ITHit.WebDAV.Server.Class2.LockInfo structure to this method by reference. All fields of the structure are provided by WebDAV client except ITHit.WebDAV.Server.Class2.LockInfo.Token field. In your Lock implementation you must create lock token and set ITHit.WebDAV.Server.Class2.LockInfo.Token member. You must also associate generated token with the hierarchy item in the repository during this call. The token is sent to the WebDAV client.

public Task<LockResult> LockAsync(LockLevel level, bool isDeep, TimeSpan? requestedTimeOut, string owner)

Parameters

level
ITHit.WebDAV.Server.Class2.LockLevel

Whether lock is share or exclusive

isDeep
bool

Whether lock is deep.

requestedTimeOut
System.TimeSpan?

Lock timeout which was requested by client. Server may ignore this parameter and set any timeout.

owner
string

Owner of the lock as specified by client.

Returns

System.Threading.Tasks.Task

Instance of ITHit.WebDAV.Server.Class2.LockResult with information about the lock.