17 using System.Collections.Generic;
36 Update(changes, securities.Add, removed => securities.Remove(removed));
47 Update(changes, added => securities.Add(valueFactory(added)), removed => securities.Remove(valueFactory(removed)));
57 IDictionary<Security, TValue> dictionary,
59 Func<Security, TValue> valueFactory
62 UpdateDictionary(dictionary, changes, security => security, valueFactory);
72 IDictionary<Symbol, TValue> dictionary,
74 Func<Security, TValue> valueFactory
77 UpdateDictionary(dictionary, changes, security => security.Symbol, valueFactory);
90 IDictionary<TKey, TValue> dictionary,
92 Func<Security, TKey> keyFactory,
93 Func<Security, TValue> valueFactory
97 added => dictionary.Add(keyFactory(added), valueFactory(added)),
100 var key = keyFactory(removed);
101 var entry = dictionary[key];
102 dictionary.Remove(key);
105 var disposable = entry as IDisposable;
106 disposable.DisposeSafely();
118 foreach (var added
in changes.AddedSecurities)
122 foreach (var removed
in changes.RemovedSecurities)