IHierarchyItem.ActiveLocks Property

IT Hit WebDAV for .NET

Array of item's lock descriptions.

[Visual Basic]
Property ActiveLocks As LockInfo()
[C#]
LockInfo[] ActiveLocks {get;}

Property Value

Array of LockInfo objects representing locks.

Remarks

If item has no locks, an empty array is returned.

Example

string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IHierarchyItem item = session.OpenResource(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

IHierarchyItem Interface | ITHit.WebDAV.Client Namespace