Пример #1
0
 public static int BinarySearch <T>(this IList <T> source, T value)
 {
     return(Colls.BinarySearch(source, t => t, value));
 }
Пример #2
0
 public static int BinarySearch <TSource, TValue>(this IList <TSource> source, Func <TSource, TValue> map, TValue value)
 {
     return(Colls.BinarySearch(source, map, value, Comparer <TValue> .Default));
 }
Пример #3
0
 public static IEnumerable <T> RemoveIf <T>(this IList <T> source, Func <T, bool> predicate)
 {
     return(Colls.RemoveIf(source, predicate));
 }
Пример #4
0
 public static IEnumerable <T> Merge <T>(this IEnumerable <T> source, IEnumerable <T> right, int limit)
 {
     return(Colls.Merge(source, right, limit));
 }
Пример #5
0
 public static IReadOnlyList <T> OfList <T>(params T[] @params)
 {
     return(Colls.OfList(@params).AsReadOnly());
 }
Пример #6
0
 public static IEnumerable <string> RemoveDuplicatesIgnoreCase(this IList <string> source)
 {
     return(Colls.RemoveDuplicatesIgnoreCase(source));
 }
Пример #7
0
 public static T GetOrAdd <T>(this ICollection <T> source, Func <T, bool> selector, Func <T> factory)
 {
     return(Colls.GetOrAdd(source, selector, factory));
 }
Пример #8
0
 public static int BinarySearch <T>(this IList <T> source, int index, int length, T value, IComparer <T> comparer)
 {
     return(Colls.BinarySearch(source, index, length, t => t, value, comparer));
 }
Пример #9
0
        public static IEnumerable <T> AddIfNotExist <T>(this IEnumerable <T> source, T value, Func <T, bool> existFunc = null)
        {
            Func <T, bool> condition = t => !source.Contains(t);

            return(Colls.AddIf(source, value, v => existFunc?.Invoke(v) ?? condition(v)));
        }
Пример #10
0
 public static IEnumerable <T> AddIfNotNull <T>(this IEnumerable <T> source, T value)
 {
     return(Colls.AddIf(source, value, v => v is not null));
 }
Пример #11
0
 public static IEnumerable <T> AddIf <T>(this IEnumerable <T> source, T value, Func <T, bool> condition)
 {
     return(Colls.AddIf(source, value, condition));
 }
Пример #12
0
 public static IEnumerable <T> AddIf <T>(this IEnumerable <T> source, T value, bool flag)
 {
     return(Colls.AddIf(source, value, flag));
 }
Пример #13
0
 public static IEnumerable <T> AddRange <T>(this IEnumerable <T> source, IEnumerable <T> collection, int limit)
 {
     return(Colls.AddRange(source, collection, limit));
 }
Пример #14
0
 public static int BinarySearch <T>(this IList <T> source, T value, IComparer <T> comparer)
 {
     return(Colls.BinarySearch(source, 0, source.Count, t => t, value, comparer));
 }
Пример #15
0
 public static IEnumerable <TSource> RemoveDuplicates <TSource>(this IList <TSource> source)
 {
     return(Colls.RemoveDuplicates(source));
 }
Пример #16
0
 public static int BinarySearch <TSource, TValue>(this IList <TSource> source, Func <TSource, TValue> map, TValue value, IComparer <TValue> comparer)
 {
     return(Colls.BinarySearch(source, 0, source.Count, map, value, comparer));
 }
Пример #17
0
 public static IEnumerable <TSource> RemoveDuplicates <TSource, TCheck>(this IList <TSource> source, Func <TSource, TCheck> duplicatePredicate)
 {
     return(Colls.RemoveDuplicates(source, duplicatePredicate));
 }
Пример #18
0
 public static int BinarySearch <TSource, TValue>(this IList <TSource> source, int index, int length, Func <TSource, TValue> map, TValue value, IComparer <TValue> comparer)
 {
     return(Colls.BinarySearch(source, index, length, map, value, comparer));
 }
Пример #19
0
 public static IReadOnlyList <T> OfList <T>(IEnumerable <T> list, params IEnumerable <T>[] listParams)
 {
     return(Colls.OfList(list, listParams).AsReadOnly());
 }