Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DictionaryWrapper.cs
Go to the documentation of this file.
2
4
5internal sealed class DictionaryWrapper : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, IDictionary, ICollection
6{
8
9 public string this[string key]
10 {
11 get
12 {
13 return _contents[key];
14 }
15 set
16 {
18 }
19 }
20
21 public object this[object key]
22 {
23 get
24 {
25 return this[(string)key];
26 }
27 set
28 {
29 this[(string)key] = (string)value;
30 }
31 }
32
34
36
37 ICollection IDictionary.Keys => _contents.Keys;
38
39 ICollection IDictionary.Values => _contents.Values;
40
41 public int Count => _contents.Count;
42
43 public bool IsReadOnly => ((IDictionary)_contents).IsReadOnly;
44
45 public bool IsSynchronized => ((ICollection)_contents).IsSynchronized;
46
47 public bool IsFixedSize => ((IDictionary)_contents).IsFixedSize;
48
49 public object SyncRoot => ((ICollection)_contents).SyncRoot;
50
52 {
53 _contents = contents;
54 }
55
56 public void Add(string key, string value)
57 {
58 this[key] = value;
59 }
60
62 {
63 Add(item.Key, item.Value);
64 }
65
66 public void Add(object key, object value)
67 {
68 Add((string)key, (string)value);
69 }
70
71 public void Clear()
72 {
74 }
75
77 {
78 if (_contents.ContainsKey(item.Key))
79 {
80 return _contents[item.Key] == item.Value;
81 }
82 return false;
83 }
84
85 public bool Contains(object key)
86 {
87 return ContainsKey((string)key);
88 }
89
90 public bool ContainsKey(string key)
91 {
93 }
94
95 public bool ContainsValue(string value)
96 {
98 }
99
104
105 public void CopyTo(Array array, int index)
106 {
108 }
109
110 public bool Remove(string key)
111 {
112 return _contents.Remove(key);
113 }
114
115 public void Remove(object key)
116 {
117 Remove((string)key);
118 }
119
121 {
122 if (!Contains(item))
123 {
124 return false;
125 }
126 return Remove(item.Key);
127 }
128
129 public bool TryGetValue(string key, out string value)
130 {
132 }
133
138
143
148}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
bool Contains(KeyValuePair< string, string > item)
bool Remove(KeyValuePair< string, string > item)
readonly Dictionary< string, string > _contents
DictionaryWrapper(Dictionary< string, string > contents)
bool TryGetValue(string key, out string value)
void Add(KeyValuePair< string, string > item)
void CopyTo(KeyValuePair< string, string >[] array, int arrayIndex)
IEnumerator< KeyValuePair< string, string > > GetEnumerator()
new IDictionaryEnumerator GetEnumerator()