Click or drag to resize

IPropertyMultistatusResponseAsync 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: 2.0.420.0
Syntax
public interface IPropertyMultistatusResponseAsync : IMultistatusResponseAsync

The IPropertyMultistatusResponseAsync type exposes the following members.

Properties
  NameDescription
Public propertyDescription
Description of error, if available.
(Inherited from IMultistatusResponseAsync.)
Public propertyHref
Url of the item.
(Inherited from IMultistatusResponseAsync.)
Public propertyPropertyName
Name of the property, if element is property. Otherwise null.
Public propertyStatus
HTTP Status of the operation.
(Inherited from IMultistatusResponseAsync.)
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...
WebDavSessionAsync session = new WebDavSessionAsync(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IFileAsync file = await session.OpenFileAsync(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(IPropertyMultistatusResponseAsync propInfo in ex.Multistatus.Responses)
    {
        Console.WriteLine(propInfo.PropertyName + " " + propInfo.Description);
    }
}
See Also