/// <summary>
        /// Initializes a new <see cref="SynchronizedKeyedCollection{TKey,TValue}"/> and specifies an existing lock
        /// and the default equality comparer.
        /// </summary>
        /// <param name="lock">An existing lock.</param>
        protected SynchronizedKeyedCollection(ReaderWriterLockWrapper @lock)
        {
            if (@lock == null)
            {
                throw new ArgumentNullException("lock");
            }

            this.dictionary = new SynchronizedDictionary(this, @lock);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new <see cref="ObservableSynchronizedDictionary{TKey,TValue}"/> with a new lock, but specifies
 /// the equality comparer.
 /// </summary>
 /// <param name="comparer">An equality comparer.</param>
 public ObservableSynchronizedDictionary(IEqualityComparer <TKey> comparer)
 {
     if (comparer == null)
     {
         throw new ArgumentNullException("comparer");
     }
     this.dictionary = new Dictionary <TKey, Slot>(comparer);
     this.slotToKey  = new Dictionary <int, TKey>();
     this.@lock      = new ReaderWriterLockWrapper(this);
 }
예제 #3
0
        /// <summary>
        /// Initializes a new <see cref="ObservableSynchronizedDictionary{TKey,TValue}"/> and specifies an existing lock
        /// and the default equality comparer.
        /// </summary>
        /// <param name="lock">An existing lock.</param>
        public ObservableSynchronizedDictionary(ReaderWriterLockWrapper @lock)
        {
            if (@lock == null)
            {
                throw new ArgumentNullException("lock");
            }

            this.@lock      = @lock;
            this.dictionary = new Dictionary <TKey, Slot>();
            this.slotToKey  = new Dictionary <int, TKey>();
        }
        /// <summary>
        /// Initializes a new <see cref="SynchronizedKeyedCollection{TKey,TValue}"/> and specifies an existing
        /// lock and a comparer.
        /// </summary>
        /// <param name="comparer">The comparer.</param>
        /// <param name="lock">An existing lock.</param>
        protected SynchronizedKeyedCollection(IEqualityComparer <TKey> comparer, ReaderWriterLockWrapper @lock)
        {
            if (comparer == null)
            {
                throw new ArgumentNullException("comparer");
            }
            if (@lock == null)
            {
                throw new ArgumentNullException("lock");
            }

            this.dictionary = new SynchronizedDictionary(this, comparer, @lock);
        }
예제 #5
0
 /// <summary>
 /// Initializes a new <see cref="ObservableSynchronizedDictionary{TKey,TValue}"/> with a new lock and
 /// the default equality comparer.
 /// </summary>
 public ObservableSynchronizedDictionary()
 {
     this.@lock = new ReaderWriterLockWrapper(this);
 }
 public SynchronizedDictionary(SynchronizedKeyedCollection <TKey, TValue> parent,
                               IEqualityComparer <TKey> comparer, ReaderWriterLockWrapper @lock)
     : base(comparer, @lock)
 {
     this.parent = parent;
 }
 public SynchronizedDictionary(SynchronizedKeyedCollection <TKey, TValue> parent, ReaderWriterLockWrapper @lock)
     : base(@lock)
 {
     this.parent = parent;
 }
 internal Cookie( CookieAction action, ReaderWriterLockWrapper parent, StackTrace stackTrace )
 {
     this.action = action;
     this.parent = parent;
     this.stackTrace = stackTrace;
 }
예제 #9
0
 internal Cookie(CookieAction action, ReaderWriterLockWrapper parent, StackTrace stackTrace)
 {
     this.action     = action;
     this.parent     = parent;
     this.stackTrace = stackTrace;
 }