FileSurfer 2.1.2
Cross-platform file manager with support for Git and SFTP
Loading...
Searching...
No Matches
FileSurfer.Core.Extensions.CollectionExtensions Class Reference

Provides helper extension methods for working with collections. More...

Static Public Member Functions

static TOut[] ConvertToArray< TIn, TOut > (this IReadOnlyCollection< TIn > collection, Func< TIn, TOut > action)
 Converts a read-only collection into an array by projecting each item.
static T[] ConvertToArray< T > (this IReadOnlyCollection< T > collection)
 Copies a read-only collection into a new array.
static IEnumerable< int > EfficientChunk< T > (this IEnumerable< T > source, T[] buffer)
 Enumerates chunk sizes while filling a reusable buffer from a source sequence.
static bool EqualsUnordered< T > (this IReadOnlyCollection< T > collectionA, IReadOnlyCollection< T > collectionB)
 Determines whether two collections contain the same items with the same multiplicities, regardless of order.

Detailed Description

Provides helper extension methods for working with collections.

Member Function Documentation

◆ ConvertToArray< T >()

T[] FileSurfer.Core.Extensions.CollectionExtensions.ConvertToArray< T > ( this IReadOnlyCollection< T > collection)
inlinestatic

Copies a read-only collection into a new array.

Parameters
collectionThe source collection.
Returns
An array containing source items in source order.

◆ ConvertToArray< TIn, TOut >()

TOut[] FileSurfer.Core.Extensions.CollectionExtensions.ConvertToArray< TIn, TOut > ( this IReadOnlyCollection< TIn > collection,
Func< TIn, TOut > action )
inlinestatic

Converts a read-only collection into an array by projecting each item.

Parameters
collectionThe source collection.
actionThe projection function applied to each source item.
Returns
An array containing projected items in source order.

◆ EfficientChunk< T >()

IEnumerable< int > FileSurfer.Core.Extensions.CollectionExtensions.EfficientChunk< T > ( this IEnumerable< T > source,
T[] buffer )
inlinestatic

Enumerates chunk sizes while filling a reusable buffer from a source sequence.

Parameters
sourceThe source sequence to chunk.
bufferThe reusable destination buffer.
Returns
A sequence of chunk lengths written into buffer .

◆ EqualsUnordered< T >()

bool FileSurfer.Core.Extensions.CollectionExtensions.EqualsUnordered< T > ( this IReadOnlyCollection< T > collectionA,
IReadOnlyCollection< T > collectionB )
inlinestatic

Determines whether two collections contain the same items with the same multiplicities, regardless of order.

Parameters
collectionAThe first collection.
collectionBThe second collection.
Returns
true when both collections are equivalent as multisets; otherwise, false.
Type Constraints
T :IComparable<T> 

The documentation for this class was generated from the following file: