Click or drag to resize

IHierarchyItemAsyncUnlockAsync Method

IT Hit WebDAV Classes Reference
Removes the lock.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
Task UnlockAsync(
	string lockToken
)

Parameters

lockToken
Type: SystemString

[Missing <param name="lockToken"/> documentation for "M:ITHit.WebDAV.Client.IHierarchyItemAsync.UnlockAsync(System.String)"]

Return Value

Type: Task

[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IHierarchyItemAsync.UnlockAsync(System.String)"]

Exceptions
ExceptionCondition
PreconditionFailedExceptionThe item is not locked.
MethodNotAllowedExceptionThe item does not support locking.
NotFoundExceptionThe item doesn't exist on the server.
WebDavExceptionUnexpected error occurred.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSessionAsync session = new WebDavSessionAsync(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IHierarchyItemAsync item = await session.OpenFileAsync(new Uri("http://server:8580/Products/Sales.txt"));
IFolderAsync destFolder = await session.OpenFolderAsync(new Uri("http://server:8580/Info/"));
LockInfo lockInfo = item.Lock(LockScope.Shared, false, "User 1", new TimeSpan(0, 20, 0));
item.CopyTo(destFolder, "Copy of " + item.DisplayName, false, false);
item.Unlock(lockInfo.LockToken.LockToken);
See Also