Click or drag to resize

IHierarchyItemAsyncActiveLocks Property

IT Hit WebDAV Classes Reference
Array of item's lock descriptions.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
LockInfo[] ActiveLocks { get; }

Property Value

Type: LockInfo
Array of LockInfo objects representing locks.
Remarks
If item has no locks, an empty array is returned.
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:8080/Products/Sales.txt"));
foreach(LockInfo lockInfo in item.ActiveLocks)
{
    string timout = lockInfo.TimeOut == TimeSpan.MaxValue ? "Infinite" : lockInfo.TimeOut.TotalSeconds.ToString();
    Console.WriteLine(lockInfo.Owner 
        + " " + lockInfo.LockToken.Href 
        + " " + lockInfo.LockToken.LockToken 
        + " " + lockInfo.LockScope 
        + " " + lockInfo.Deep
        + " " + timout);
}
See Also