public OcThreadSafeDictionary(string name, int capacity) { Name = string.IsNullOrWhiteSpace(name) ? $"Un-Named {GetType().FriendlyName()}" : name.Trim(); _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _dictionary = new Dictionary <TKey, TValue>(capacity); }
public OcThreadSafeDictionary(IEqualityComparer <TKey> comparer) { Name = $"Un-Named {GetType().FriendlyName()}"; _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _dictionary = new Dictionary <TKey, TValue>(comparer); }
public OcThreadSafeDictionary(int capacity) { Name = $"Un-Named {GetType().FriendlyName()}"; _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _dictionary = new Dictionary <TKey, TValue>(capacity); }
public OcThreadSafeList(string name, int capacity) { Name = string.IsNullOrWhiteSpace(name) ? $"Un-Named {GetType().FriendlyName()}" : name.Trim(); _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _list = new List <T>(capacity); }
public OcThreadSafeDictionary(string name, IDictionary <TKey, TValue> dictionary, IEqualityComparer <TKey> comparer) { Name = string.IsNullOrWhiteSpace(name) ? $"Un-Named {GetType().FriendlyName()}" : name.Trim(); _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _dictionary = new Dictionary <TKey, TValue>(dictionary, comparer); }
public OcThreadSafeList(string name, IEnumerable <T> collection) { Name = string.IsNullOrWhiteSpace(name) ? $"Un-Named {GetType().FriendlyName()}" : name.Trim(); _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _list = new List <T>(collection); }
public OcThreadSafeList(int capacity) { Name = $"Un-Named {GetType().FriendlyName()}"; _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _list = new List <T>(capacity); }
public OcThreadSafeList(IEnumerable <T> collection) { Name = $"Un-Named {GetType().FriendlyName()}"; _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _list = new List <T>(collection); }
public OcThreadSafeHashSet(string name, IEnumerable <T> collection, IEqualityComparer <T> comparer) { Name = string.IsNullOrWhiteSpace(name) ? $"Un-Named {GetType().FriendlyName()}" : name.Trim(); _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _hashSet = new HashSet <T>(collection, comparer); }
public OcThreadSafeHashSet(IEnumerable <T> collection, IEqualityComparer <T> comparer) { Name = $"Un-Named {GetType().FriendlyName()}"; _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _hashSet = new HashSet <T>(collection, comparer); }
public OcThreadSafeHashSet(string name) { Name = string.IsNullOrWhiteSpace(name) ? $"Un-Named {GetType().FriendlyName()}" : name.Trim(); _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _hashSet = new HashSet <T>(); }
public OcThreadSafeHashSet() { Name = $"Un-Named {GetType().FriendlyName()}"; _lock = new OcThreadLockReadWrite($"Lock for {Name}"); _hashSet = new HashSet <T>(); }