Click or drag to resize

IHierarchyItemGetPropertyValuesAsync Method

IT Hit WebDAV Classes Reference
Retrieves values of specific properties.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
Task<Property[]> GetPropertyValuesAsync(
	PropertyName[] names,
	IDictionary<string, string> headers = null,
	CancellationToken cancellationToken = null
)

Parameters

names
Type: ITHit.WebDAV.ClientPropertyName

[Missing <param name="names"/> documentation for "M:ITHit.WebDAV.Client.IHierarchyItem.GetPropertyValuesAsync(ITHit.WebDAV.Client.PropertyName[],System.Collections.Generic.IDictionary{System.String,System.String},System.Threading.CancellationToken)"]

headers (Optional)
Type: System.Collections.GenericIDictionaryString, String
Request headers.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
Propagates notification that operations should be canceled.

Return Value

Type: TaskProperty
Array of requested properties with values.
Exceptions
ExceptionCondition
NotFoundExceptionThis item doesn't exist on the server.
PropertyForbiddenExceptionUser has not enough rights to obtain one of requested properties.
PropertyNotFoundExceptionIf one of requested properties was not found.
PropertyExceptionServer returned unknown error for specific property.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionUnexpected error occurred.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd", "DOMAIN");

IHierarchyItem item = await session.GetFileAsync(new Uri("https://server/Library/doc.txt"));
PropertyName[] propNames = new PropertyName[2];
propNames[0] = new PropertyName("ManagerApproved", "Sales");
propNames[1] = new PropertyName("Branch", "Sales");

Property[] properties = await item.GetPropertyValuesAsync(propNames);

foreach(Property prop in properties)
{
    Console.WriteLine(prop.Name.NamespaceUri + ":" + prop.Name.Name + " " + prop.StringValue);
}
See Also