Пример #1
0
        /// <summary>
        /// Retrieves all the elements in <paramref name="source"/> that match the conditions defined by the specified function delegate <paramref name="match"/>.
        /// </summary>
        /// <param name="source">The sequence to search and apply paging on.</param>
        /// <param name="match">The function delegate that defines the conditions of the elements to search for.</param>
        /// <param name="settings">The settings that specifies the conditions of the <paramref name="match"/> before applying paging to this instance.</param>
        /// <param name="comparison">One of the enumeration values that specifies the rules to use in the comparison.</param>
        /// <returns>A <see cref="PagedCollection{T}"/> that is the result of <paramref name="match"/>.</returns>
        public static PagedCollection <T> Search <T>(IEnumerable <T> source, Func <T, PagedSettings, StringComparison, bool> match, PagedSettings settings, StringComparison comparison)
        {
            Validator.ThrowIfNull(source, nameof(source));
            Validator.ThrowIfNull(match, nameof(match));
            Validator.ThrowIfNull(settings, nameof(settings));

            PagedCollection <T> pagedSource = source as PagedCollection <T>;

            return(new PagedCollection <T>(new List <T>(EnumerableUtility.FindAll(pagedSource == null ? source : pagedSource.OriginalSource, match, settings, comparison)), settings));
        }
Пример #2
0
 /// <summary>
 /// Retrieves all the elements that match the conditions defined by the specified function delegate.
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of the sequence.</typeparam>
 /// <typeparam name="T1">The type of the first parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T2">The type of the second parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T3">The type of the third parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T4">The type of the fourth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T5">The type of the fifth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T6">The type of the sixth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T7">The type of the seventh parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T8">The type of the eighth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T9">The type of the ninth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <param name="source">The sequence to search.</param>
 /// <param name="match">The function delegate that defines the conditions of the elements to search for.</param>
 /// <param name="arg1">The first parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg2">The second parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg3">The third parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg4">The fourth parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg5">The fifth parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg6">The sixth parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg7">The seventh parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg8">The eighth parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg9">The ninth parameter of the delegate <paramref name="match"/>.</param>
 /// <returns>An <see cref="IEnumerable{T}"/> sequence containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty <see cref="IEnumerable{T}"/>.</returns>
 public static IEnumerable <TSource> FindAll <TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9>(this IEnumerable <TSource> source, Func <TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, bool> match, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
 {
     return(EnumerableUtility.FindAll(source, match, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9));
 }
Пример #3
0
 /// <summary>
 /// Retrieves all the elements that match the conditions defined by the specified function delegate.
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of the sequence.</typeparam>
 /// <typeparam name="T1">The type of the first parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T2">The type of the second parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T3">The type of the third parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <param name="source">The sequence to search.</param>
 /// <param name="match">The function delegate that defines the conditions of the elements to search for.</param>
 /// <param name="arg1">The first parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg2">The second parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg3">The third parameter of the delegate <paramref name="match"/>.</param>
 /// <returns>An <see cref="IEnumerable{T}"/> sequence containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty <see cref="IEnumerable{T}"/>.</returns>
 public static IEnumerable <TSource> FindAll <TSource, T1, T2, T3>(this IEnumerable <TSource> source, Func <TSource, T1, T2, T3, bool> match, T1 arg1, T2 arg2, T3 arg3)
 {
     return(EnumerableUtility.FindAll(source, match, arg1, arg2, arg3));
 }
Пример #4
0
 /// <summary>
 /// Retrieves all the elements that match the conditions defined by the specified function delegate.
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of the sequence.</typeparam>
 /// <typeparam name="T1">The type of the first parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T2">The type of the second parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T3">The type of the third parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T4">The type of the fourth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T5">The type of the fifth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <typeparam name="T6">The type of the sixth parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <param name="source">The sequence to search.</param>
 /// <param name="match">The function delegate that defines the conditions of the elements to search for.</param>
 /// <param name="arg1">The first parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg2">The second parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg3">The third parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg4">The fourth parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg5">The fifth parameter of the delegate <paramref name="match"/>.</param>
 /// <param name="arg6">The sixth parameter of the delegate <paramref name="match"/>.</param>
 /// <returns>An <see cref="IEnumerable{T}"/> sequence containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty <see cref="IEnumerable{T}"/>.</returns>
 public static IEnumerable <TSource> FindAll <TSource, T1, T2, T3, T4, T5, T6>(this IEnumerable <TSource> source, Func <TSource, T1, T2, T3, T4, T5, T6, bool> match, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
 {
     return(EnumerableUtility.FindAll(source, match, arg1, arg2, arg3, arg4, arg5, arg6));
 }
Пример #5
0
 /// <summary>
 /// Retrieves all the elements that match the conditions defined by the specified function delegate.
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of the sequence.</typeparam>
 /// <typeparam name="T">The type of the first parameter of the delegate <paramref name="match"/>.</typeparam>
 /// <param name="source">The sequence to search.</param>
 /// <param name="match">The function delegate that defines the conditions of the elements to search for.</param>
 /// <param name="arg">The first parameter of the delegate <paramref name="match"/>.</param>
 /// <returns>An <see cref="IEnumerable{T}"/> sequence containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty <see cref="IEnumerable{T}"/>.</returns>
 public static IEnumerable <TSource> FindAll <TSource, T>(this IEnumerable <TSource> source, Func <TSource, T, bool> match, T arg)
 {
     return(EnumerableUtility.FindAll(source, match, arg));
 }