Click or drag to resize

LockInfo Class

IT Hit WebDAV Classes Reference
Information about lock set on an item.
Inheritance Hierarchy
SystemObject
  ITHit.WebDAV.ClientLockInfo

Namespace:  ITHit.WebDAV.Client
Assemblies:   ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
[SerializableAttribute]
public sealed class LockInfo

The LockInfo type exposes the following members.

Constructors
  NameDescription
Public methodLockInfo
Initializes new instance of LockInfo.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldDeep
Whether lock is set on item's children.
Public fieldLockScope
Scope of the lock.
Public fieldLockToken
Lock token.
Public fieldOwner
Owner's name.
Public fieldCode exampleTimeOut
Timeout until lock expires.
Top
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IHierarchyItem item = session.OpenFile(new Uri("http://server:8580/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