Class CollectionExtensions
Extension methods for the collections
Inherited Members
Namespace:FubarDev.WebDavServer.FileSystem
Assembly:FubarDev.WebDavServer.dll
Syntax
public static class CollectionExtensions
Methods
| Improve this Doc View SourceEnumerateEntries(ICollection, IReadOnlyCollection<IEntry>, Int32)
Gets all entries of a collection recursively
Declaration
public static IAsyncEnumerable<IEntry> EnumerateEntries(this ICollection collection, IReadOnlyCollection<IEntry> children, int maxDepth)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The collection to get the entries from |
IReadOnlyCollection<IEntry> | children | Child items for the given collection |
Int32 | maxDepth | The maximum depth (0 = only entries of the collection, but not of its sub collections) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<IEntry> | An async enumerable to collect all the entries recursively |
EnumerateEntries(ICollection, Int32)
Gets all entries of a collection recursively
Declaration
public static IAsyncEnumerable<IEntry> EnumerateEntries(this ICollection collection, int maxDepth)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The collection to get the entries from |
Int32 | maxDepth | The maximum depth (0 = only entries of the collection, but not of its sub collections) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<IEntry> | An async enumerable to collect all the entries recursively |
GetMountTargetAsync(ICollection, IMountPointProvider)
Returns the target if the collection is a mount point or the collection itself
Declaration
public static Task<ICollection> GetMountTargetAsync([NotNull] this ICollection collection, [CanBeNull] IMountPointProvider mountPointProvider)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The collection to found the mount destination for |
IMountPointProvider | mountPointProvider | The mount point provider |
Returns
Type | Description |
---|---|
Task<ICollection> | The collection or the destination collection if a mount point existed |
GetMountTargetEntryAsync(ICollection, IMountPointProvider)
Returns the target if the collection is a mount point or the collection itself
Declaration
public static Task<IEntry> GetMountTargetEntryAsync([NotNull] this ICollection collection, [CanBeNull] IMountPointProvider mountPointProvider)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The collection to found the mount destination for |
IMountPointProvider | mountPointProvider | The mount point provider |
Returns
Type | Description |
---|---|
Task<IEntry> | The collection or the destination collection if a mount point existed |
GetNodeAsync(ICollection, Int32, CancellationToken)
Gets the collection as node
Declaration
public static Task<ICollectionNode> GetNodeAsync(this ICollection collection, int maxDepth, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The collection to get the node for |
Int32 | maxDepth | The maximum depth to be used to get the child nodes |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<ICollectionNode> | The collection node |