Exemple #1
0
        /// <summary>Default implementation of <see cref="IDictionaryEx{K, V}.AddRange"/>.
        /// Merges the contents of the specified sequence into this map.</summary>
        public static int AddRange <K, V>(this IDictionary <K, V> dict, IEnumerable <KeyValuePair <K, V> > data, DictEditMode mode)
        {
            var e          = data.GetEnumerator();
            int numMissing = 0;

            foreach (var pair in data)
            {
                K key = pair.Key;
                V val = pair.Value;
                if (!LCInterfaces.GetAndEdit(dict, key, ref val, mode))
                {
                    numMissing++;
                }
            }
            return(numMissing);
        }
Exemple #2
0
 void ICollection <Num> .CopyTo(Num[] array, int arrayIndex)
 {
     LCInterfaces.CopyTo(this, array, arrayIndex);
 }
Exemple #3
0
 /// <summary>Gets the highest index at which a condition is true, or -1 if nowhere.</summary>
 public static int LastIndexWhere <T>(this IListAndListSource <T> list, Func <T, bool> pred)
 {
     return(LCInterfaces.LastIndexWhere(list, pred));
 }
Exemple #4
0
 public int IndexOf(T item)
 {
     return(LCInterfaces.IndexOf(this, item));
 }
Exemple #5
0
 void ICollectionSource <T> .CopyTo(T[] array, int arrayIndex)
 {
     LCInterfaces.CopyTo(this, array, arrayIndex);
 }
Exemple #6
0
 void ICollection <int> .CopyTo(int[] array, int arrayIndex)
 {
     LCInterfaces.CopyTo(this, array, arrayIndex);
 }