Click or drag to resize

Property Class

IT Hit WebDAV Classes Reference
WebDAV Property that represents xml properties as well as allows to access simple string properties.
Inheritance Hierarchy
SystemObject
  ITHit.WebDAV.ClientProperty

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
[SerializableAttribute]
public class Property

The Property type exposes the following members.

Constructors
  NameDescription
Public methodProperty(PropertyName, String)
Initializes new string valued property.
Public methodProperty(String, String, String)
Initializes new string valued property by given name and namespace.
Top
Properties
  NameDescription
Public propertyCode exampleStringValue
String value of the custom property.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(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.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns string representation of current property.
(Overrides ObjectToString.)
Top
Fields
  NameDescription
Public fieldCode exampleName
Property Name.
Top
Remarks
This class represents custom property exposed by WebDAV hierarchy items.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IFile file = await session.GetFileAsync(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
{
    await file.UpdatePropertiesAsync(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);
    }
}
See Also