Esempio n. 1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="afterAdded"></param>
 /// <param name="afterRemoved"></param>
 /// <param name="beforeAdd"></param>
 /// <param name="beforeRemove"></param>
 public BidirectionalDictionary(
     BidirectionalDictionaryKeyValueCallback <TKey, TValue> afterAdded
     , BidirectionalDictionaryKeyValueCallback <TKey, TValue> afterRemoved
     , BidirectionalDictionaryKeyValueCallback <TKey, TValue> beforeAdd    = null
     , BidirectionalDictionaryKeyValueCallback <TKey, TValue> beforeRemove = null)
     : this(new Dictionary <TKey, TValue>(), afterAdded, afterRemoved, beforeAdd, beforeRemove)
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="dictionary"></param>
 /// <param name="afterAdded"></param>
 /// <param name="afterRemoved"></param>
 /// <param name="beforeAdd"></param>
 /// <param name="beforeRemove"></param>
 public BidirectionalDictionary(IDictionary <TKey, TValue> dictionary
                                , BidirectionalDictionaryKeyValueCallback <TKey, TValue> afterAdded   = null
                                , BidirectionalDictionaryKeyValueCallback <TKey, TValue> afterRemoved = null
                                , BidirectionalDictionaryKeyValueCallback <TKey, TValue> beforeAdd    = null
                                , BidirectionalDictionaryKeyValueCallback <TKey, TValue> beforeRemove = null)
 {
     _dictionary   = dictionary;
     _afterAdded   = afterAdded ?? DefaultCallback;
     _afterRemoved = afterRemoved ?? DefaultCallback;
     _beforeAdd    = beforeAdd ?? DefaultCallback;
     _beforeRemove = beforeRemove ?? DefaultCallback;
 }