4 using System.Collections.Generic;
6 namespace SiliconStudio.Core.Collections
13 public class ReadOnlyDictionary<TKey, TValue> :
IDictionary<TKey, TValue>
23 this.dictionary = dictionary;
35 get {
return dictionary.Values; }
41 get {
return dictionary.Count; }
45 public bool IsReadOnly
51 public TValue
this[TKey key]
53 get {
return dictionary[key]; }
54 set {
throw new NotSupportedException(
"Read-only dictionary"); }
58 public void Add(TKey key, TValue value)
60 throw new NotSupportedException(
"Read-only dictionary");
66 return dictionary.ContainsKey(key);
72 throw new NotSupportedException(
"Read-only dictionary");
78 return dictionary.TryGetValue(key, out value);
82 public void Add(KeyValuePair<TKey, TValue> item)
84 throw new NotSupportedException(
"Read-only dictionary");
90 throw new NotSupportedException(
"Read-only dictionary");
94 public bool Contains(KeyValuePair<TKey, TValue> item)
96 return dictionary.Contains(item);
100 public void CopyTo(KeyValuePair<TKey, TValue>[] array,
int arrayIndex)
102 dictionary.CopyTo(array, arrayIndex);
106 public bool Remove(KeyValuePair<TKey, TValue> item)
108 throw new NotSupportedException(
"Read-only dictionary");
114 return dictionary.GetEnumerator();
118 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
120 return dictionary.GetEnumerator();
SiliconStudio.Paradox.Input.Keys Keys
void CopyTo(KeyValuePair< TKey, TValue >[] array, int arrayIndex)
IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator()
bool TryGetValue(TKey key, out TValue value)
bool Remove(KeyValuePair< TKey, TValue > item)
void Add(KeyValuePair< TKey, TValue > item)
ReadOnlyDictionary(IDictionary< TKey, TValue > dictionary)
Initializes a new instance of the ReadOnlyDictionary<TKey, TValue> class.
void Add(TKey key, TValue value)
bool ContainsKey(TKey key)
bool Contains(KeyValuePair< TKey, TValue > item)