LockedException Class

IT Hit WebDAV for .NET

The item is locked.

For a list of all members of this type, see LockedException Members.

System.Object
   System.Exception
      ITHit.WebDAV.Client.Exceptions.WebDavException
         ITHit.WebDAV.Client.Exceptions.WebDavHttpException
            ITHit.WebDAV.Client.Exceptions.LockedException

[Visual Basic]
NotInheritable Public Class LockedException
    Inherits WebDavHttpException
[C#]
public sealed class LockedException : WebDavHttpException

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Thrown when server responded with 423 (Locked) http response. This status code means the source or destination resource of a method is locked.

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: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);
 }
 

Requirements

Namespace: ITHit.WebDAV.Client.Exceptions

Assembly: ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll)

See Also

LockedException Members | ITHit.WebDAV.Client.Exceptions Namespace