IItemCollectionAsyncGetChildrenAsync Method
IT Hit WebDAV Classes Reference
Gets direct children of this folder.
Namespace:
ITHit.WebDAV.Server
Assembly:
ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 11.3.10719
Syntax Task<PageResults> GetChildrenAsync(
IList<PropertyName> propNames,
Nullable<long> offset,
Nullable<long> nResults,
IList<OrderProperty> orderProps
)
Task<PageResults> GetChildrenAsync(
IList<PropertyName> propNames,
Nullable<long> offset,
Nullable<long> nResults,
IList<OrderProperty> orderProps
)
Function GetChildrenAsync (
propNames As IList(Of PropertyName),
offset As Nullable(Of Long),
nResults As Nullable(Of Long),
orderProps As IList(Of OrderProperty)
) As Task(Of PageResults)
Function GetChildrenAsync (
propNames As IList(Of PropertyName),
offset As Nullable(Of Long),
nResults As Nullable(Of Long),
orderProps As IList(Of OrderProperty)
) As Task(Of PageResults)
Task<PageResults^>^ GetChildrenAsync(
IList<PropertyName>^ propNames,
Nullable<long long> offset,
Nullable<long long> nResults,
IList<OrderProperty>^ orderProps
)
Task<PageResults^>^ GetChildrenAsync(
IList<PropertyName>^ propNames,
Nullable<long long> offset,
Nullable<long long> nResults,
IList<OrderProperty>^ orderProps
)
abstract GetChildrenAsync :
propNames : IList<PropertyName> *
offset : Nullable<int64> *
nResults : Nullable<int64> *
orderProps : IList<OrderProperty> -> Task<PageResults>
abstract GetChildrenAsync :
propNames : IList<PropertyName> *
offset : Nullable<int64> *
nResults : Nullable<int64> *
orderProps : IList<OrderProperty> -> Task<PageResults>
Parameters
- propNames
- Type: System.Collections.GenericIListPropertyName
List of properties requested by the client. - offset
- Type: SystemNullableInt64
The number of items to skip before returning the remaining items. - nResults
- Type: SystemNullableInt64
The number of items to return. - orderProps
- Type: System.Collections.GenericIListOrderProperty
List of order properties requested by the client.
Return Value
Type:
TaskPageResultsInstance of
PageResults class that contains items on a requested page and total number of items in a folder.
Examples The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.
public virtual async Task<PageResults> GetChildrenAsync(IList<PropertyName> propNames, long? offset, long? nResults, IList<OrderProperty> orderProps)
{
IList<IHierarchyItemAsync> children = new List<IHierarchyItemAsync>();
long totalItems = 0;
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
totalItems = fileInfos.Length;
fileInfos = SortChildren(fileInfos, orderProps);
if (offset.HasValue && nResults.HasValue)
{
fileInfos = fileInfos.Skip((int)offset.Value).Take((int)nResults.Value).ToArray();
}
foreach (FileSystemInfo fileInfo in fileInfos)
{
string childPath = Path + EncodeUtil.EncodeUrlPart(fileInfo.Name);
IHierarchyItemAsync child = await context.GetHierarchyItemAsync(childPath);
if (child != null)
{
children.Add(child);
}
}
return new PageResults(children, totalItems);
}
Public Overridable Async Function GetChildrenAsync(propNames As IList(Of PropertyName), offset As Long?, nResults As Long?, orderProps As IList(Of OrderProperty)) As Task(Of PageResults) Implements IItemCollectionAsync.GetChildrenAsync
Dim children As IList(Of IHierarchyItemAsync) = New List(Of IHierarchyItemAsync)()
Dim totalItems As Long = 0
Dim fileInfos As FileSystemInfo() = dirInfo.GetFileSystemInfos()
totalItems = fileInfos.Length
fileInfos = SortChildren(fileInfos, orderProps)
If offset.HasValue AndAlso nResults.HasValue Then
fileInfos = fileInfos.Skip(CInt(offset.Value)).Take(CInt(nResults.Value)).ToArray()
End If
For Each fileInfo As FileSystemInfo In fileInfos
Dim childPath As String = Path & EncodeUtil.EncodeUrlPart(fileInfo.Name)
Dim child As IHierarchyItemAsync = Await context.GetHierarchyItemAsync(childPath)
If child IsNot Nothing Then
children.Add(child)
End If
Next
Return New PageResults(children, totalItems)
End Function
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also