Property Class

IT Hit WebDAV for .NET

WebDAV Property that represents xml properties as well as allows to access simple string properties.

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

System.Object
   ITHit.WebDAV.Client.Property

[Visual Basic]
Public Class Property
[C#]
public class Property

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

This class represents custom property exposed by WebDAV hierarchy items.

Example

 string license = "<?xml version='1.0' encoding='utf...
 WebDavSession session = new WebDavSession(license);
 session.Credentials = new NetworkCredential("User1", "pwd");
 IResource resource = session.OpenResource(new Uri("https://server/Library/doc.txt"));

 Property[] propsToAddAndUpdate = new Property[3];
 propsToAddAndUpdate[0] = new Property(new PropertyName("Ammount", "CorpNS"), "1200");
 propsToAddAndUpdate[1] = new Property(new PropertyName("ManagerApproved", "Sales"), "Yes");
 propsToAddAndUpdate[2] = new Property(new PropertyName("Branch", "Sales"), "EMEA Region");

 PropertyName[] propsToDelete = new PropertyName[2];
 propsToDelete[0] = new PropertyName("InternalName", "Sales");
 propsToDelete[1] = new PropertyName("Counter", "CorpNS");

 try
 {
     resource.UpdateProperties(propsToAddAndUpdate, propsToDelete);
 }
 catch(PropertyException ex)
 {
     Console.WriteLine(ex.Message + " " + ex.Status.Code + " " + ex.Status.Description);
     // Find which properties failed to add/update/delete
     foreach (IPropertyMultistatusResponse propInfo in ex.Multistatus.Responses)
     {
         Console.WriteLine(propInfo.PropertyName + " " + propInfo.Status.Code + " " + propInfo.Status.Description);
     }
 }
 

Requirements

Namespace: ITHit.WebDAV.Client

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

See Also

Property Members | ITHit.WebDAV.Client Namespace