示例#1
0
 public bool ContainsKey(TKey key)
 {
     using (Lock.CreateReaderScope())
     {
         return(Target.ContainsKey(key));
     }
 }
示例#2
0
 public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator()
 {
     using (Lock.CreateReaderScope())
     {
         return(Target.ToList().GetEnumerator());
     }
 }
示例#3
0
 public void CopyTo(KeyValuePair <TKey, TValue>[] array, int arrayIndex)
 {
     using (Lock.CreateReaderScope())
     {
         Target.CopyTo(array, arrayIndex);
     }
 }
示例#4
0
 public bool Contains(KeyValuePair <TKey, TValue> item)
 {
     using (Lock.CreateReaderScope())
     {
         return(Target.Contains(item));
     }
 }
示例#5
0
        public bool TryGetValue(TKey key, out TValue value)
        {
            TValue tempValue = default(TValue);

            using (Lock.CreateReaderScope())
            {
                bool found = Target.TryGetValue(key, out tempValue);

                value = tempValue;

                return(found);
            }
        }
示例#6
0
 public TValue this[TKey key]
 {
     get
     {
         using (Lock.CreateReaderScope())
         {
             return(Target[key]);
         }
     }
     set
     {
         using (Lock.CreateWriterScope())
         {
             Target[key] = value;
         }
     }
 }