Click or drag to resize

IPropertyMultistatusResponse Interface

IT Hit WebDAV Classes Reference
Provides means for finding which properties failed to update.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
public interface IPropertyMultistatusResponse : IMultistatusResponse

The IPropertyMultistatusResponse type exposes the following members.

Properties
  NameDescription
Public propertyDescription
Description of error, if available.
(Inherited from IMultistatusResponse.)
Public propertyHref
Url of the item.
(Inherited from IMultistatusResponse.)
Public propertyPropertyName
Name of the property, if element is property. Otherwise null.
Public propertyStatus
HTTP Status of the operation.
(Inherited from IMultistatusResponse.)
Top
Remarks
This interface represents an individual description of an error in the list of errors returned by server. It provides the means for finding name of the property that failed to add, update or delete during the call to UpdatePropertiesAsync(Property, PropertyName). The PropertyName member of this class returns the name of the property that failed to add, update or delete.
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)
{
    // Find which properties failed to add/update/delete
    foreach(IPropertyMultistatusResponse propInfo in ex.Multistatus.Responses)
    {
        Console.WriteLine(propInfo.PropertyName + " " + propInfo.Description);
    }
}
See Also