Ejemplo n.º 1
0
        public ThreadSafeDictionary(ThreadSafeDictionary <TKey, TValue> source)
        {
            var sourceDictionary = source.GetReadOnlyDict();

            _dict = new Dictionary <TKey, TValue>(sourceDictionary.Count, sourceDictionary.Comparer);
            foreach (var item in sourceDictionary)
            {
                _dict.Add(item.Key, item.Value);
            }
        }
Ejemplo n.º 2
0
 public ThreadSafeDictionary(ThreadSafeDictionary <TKey, TValue> source)
 {
     _comparer = source._comparer;
     _dict     = source.GetReadOnlyDict();
     GetWritableDict();  // Clone
 }