Click or drag to resize

IHierarchyItemGetProperties 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: 4.5.3121.0
Syntax
IEnumerable<PropertyValue> GetProperties(
	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: IEnumerablePropertyValue
Enumerable with property values.
Exceptions
ExceptionCondition
NeedPrivilegesExceptionThe user doesn't have enough privileges.
DavExceptionIn other cases.
Examples

The code below is part of 'WebDAVServer.NtfsStorage' sample provided with the SDK.

public IEnumerable<PropertyValue> GetProperties(IList<PropertyName> names, bool allprop)
{
    // get all properties            
    List<PropertyValue> propertyValues = getPropertyValues();
    PropertyName snippet = names.FirstOrDefault(s => s.Name == SNIPPET);

    if (snippet.Name == SNIPPET && this is DavFile)
        propertyValues.Add(new PropertyValue(snippet, (this as DavFile).Snippet));
    if (!allprop)
        propertyValues = propertyValues.Where(property => names.Contains(property.QualifiedName)).ToList();

    return propertyValues;
}
See Also