Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EventPayload.cs
Go to the documentation of this file.
4
6
7internal sealed class EventPayload : IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
8{
9 private readonly string[] m_names;
10
11 private readonly object[] m_values;
12
14
16
17 public object this[string key]
18 {
19 get
20 {
21 if (key == null)
22 {
23 throw new ArgumentNullException("key");
24 }
25 int num = 0;
26 string[] names = m_names;
27 foreach (string text in names)
28 {
29 if (text == key)
30 {
31 return m_values[num];
32 }
33 num++;
34 }
36 }
37 set
38 {
39 throw new NotSupportedException();
40 }
41 }
42
43 public int Count => m_names.Length;
44
45 public bool IsReadOnly => true;
46
47 internal EventPayload(string[] payloadNames, object[] payloadValues)
48 {
51 }
52
53 public void Add(string key, object value)
54 {
55 throw new NotSupportedException();
56 }
57
62
63 public void Clear()
64 {
65 throw new NotSupportedException();
66 }
67
69 {
70 return ContainsKey(entry.Key);
71 }
72
73 public bool ContainsKey(string key)
74 {
75 if (key == null)
76 {
77 throw new ArgumentNullException("key");
78 }
79 string[] names = m_names;
80 foreach (string text in names)
81 {
82 if (text == key)
83 {
84 return true;
85 }
86 }
87 return false;
88 }
89
91 {
92 for (int i = 0; i < Keys.Count; i++)
93 {
95 }
96 }
97
102
104 {
105 throw new NotSupportedException();
106 }
107
108 public bool Remove(string key)
109 {
110 throw new NotSupportedException();
111 }
112
114 {
115 throw new NotSupportedException();
116 }
117
118 public bool TryGetValue(string key, [MaybeNullWhen(false)] out object value)
119 {
120 if (key == null)
121 {
122 throw new ArgumentNullException("key");
123 }
124 int num = 0;
125 string[] names = m_names;
126 foreach (string text in names)
127 {
128 if (text == key)
129 {
130 value = m_values[num];
131 return true;
132 }
133 num++;
134 }
135 value = null;
136 return false;
137 }
138}
bool Remove(KeyValuePair< string, object > entry)
void Add(KeyValuePair< string, object > payloadEntry)
bool TryGetValue(string key, [MaybeNullWhen(false)] out object value)
bool Contains(KeyValuePair< string, object > entry)
void CopyTo(KeyValuePair< string, object >[] payloadEntries, int count)
EventPayload(string[] payloadNames, object[] payloadValues)
IEnumerator< KeyValuePair< string, object > > GetEnumerator()
void Add(string key, object value)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Arg_KeyNotFoundWithKey
Definition SR.cs:94
Definition SR.cs:7
new IEnumerator< T > GetEnumerator()