Click or drag to resize

IHierarchyItemGetPropertiesAsync Method

IT Hit WebDAV Classes Reference
Gets values of all properties or selected properties for this item.

Namespace:  ITHit.WebDAV.Server
Assembly:  ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 13.3.13068
Task<IEnumerable<PropertyValue>> GetPropertiesAsync(
	IList<PropertyName> props,
	bool allprop


Type: System.Collections.GenericIListPropertyName
IEnumerableT with property names which values are requested by WebDAV client. If a property does not exist for this hierarchy item then the property value shall not be returned.
Type: SystemBoolean
If it is true it means that besides properties listed in props you need to return all properties you think may be useful to client.

Return Value

Type: TaskIEnumerablePropertyValue
Enumerable with property values.
NeedPrivilegesExceptionThe user doesn't have enough privileges.
DavExceptionIn other cases.

The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.

public async Task<IEnumerable<PropertyValue>> GetPropertiesAsync(IList<PropertyName> props, bool allprop)
    List<PropertyValue> propertyValues = await GetPropertyValuesAsync();

    PropertyName snippet = props.FirstOrDefault(s => s.Name == snippetProperty);
    if (snippet.Name == snippetProperty && this is DavFile)
        propertyValues.Add(new PropertyValue(snippet, ((DavFile)this).Snippet));

    if (!allprop)
        propertyValues = propertyValues.Where(p => props.Contains(p.QualifiedName)).ToList();

    return propertyValues;
See Also