Example #1
0
 public TValue this[TKey key]
 {
     get
     {
         TValue value;
         if (_items.TryGetValue(key, out value))
         {
             return(value);
         }
         return(ReturnValue(key));
     }
     set
     {
         Assertor.AreTrue(IsReadOnly, "集合为只读");
         _items[key] = value;
     }
 }
Example #2
0
 public void Clear()
 {
     Assertor.AreTrue(IsReadOnly, "集合为只读");
     _items.Clear();
 }
Example #3
0
 public bool Remove(TKey key)
 {
     Assertor.AreTrue(IsReadOnly, "集合为只读");
     return(_items.Remove(key));
 }