Exemplo n.º 1
0
 public sealed override void AddAll(IEnumerable <KeyValuePair <TK, TV> > enumer)
 {
     this.Modify(
         () => this.AddAllImpl(enumer),
         () =>
     {
         List <TK> keys   = new List <TK>();
         List <TV> values = new List <TV>();
         foreach (KeyValuePair <TK, TV> kvp in enumer)
         {
             if (!this.ContainsKey(kvp.Key))
             {
                 keys.Add(kvp.Key);
                 values.Add(kvp.Value);
             }
         }
         return(DictionaryEventArgs.NewEventAddRange(keys, values));
     });
 }
Exemplo n.º 2
0
 public sealed override void Add(TK key, TV value)
 {
     this.Modify(
         () => this.AddImpl(key, value),
         () => DictionaryEventArgs.NewEventAddRange(new[] { key }, new[] { value }));
 }