Click or drag to resize

LockScope Enumeration

IT Hit WebDAV Classes Reference
Scope of the lock.

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 enum LockScope
Members
  Member nameValueDescription
Exclusive0 Exclusive lock.
Shared1 Shared lock.
Remarks
Represents exclusive or shared lock.
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"));

LockInfo lockInfo = null;
try
{
    lockInfo = item.Lock(LockScope.Shared, false, "User 1", TimeSpan.MaxValue);
}
catch (LockedException)
{
    Console.Write("The item is locked.");
}
catch (MethodNotAllowedException)
{
    Console.Write("The item does not alow locks.");
}
if (lockInfo!= null)
{
    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