Click or drag to resize

IHierarchyItemAsyncGetPropertiesAsync 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: 9.1.5460-Beta
Syntax
Task<IEnumerable<PropertyValue>> GetPropertiesAsync(
	IList<PropertyName> props,
	bool allprop
)

Parameters

props
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.
allprop
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.
Exceptions
ExceptionCondition
NeedPrivilegesExceptionThe user doesn't have enough privileges.
DavExceptionIn other cases.
Examples

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