Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Equal()

bool System.Security.SecurityElement.Equal ( [NotNullWhen(true)] SecurityElement? other)
inline

Definition at line 215 of file SecurityElement.cs.

216 {
217 if (other == null)
218 {
219 return false;
220 }
221 if (!string.Equals(_tag, other._tag))
222 {
223 return false;
224 }
225 if (!string.Equals(_text, other._text))
226 {
227 return false;
228 }
229 if (_attributes == null || other._attributes == null)
230 {
231 if (_attributes != other._attributes)
232 {
233 return false;
234 }
235 }
236 else
237 {
238 int count = _attributes.Count;
239 if (count != other._attributes.Count)
240 {
241 return false;
242 }
243 for (int i = 0; i < count; i++)
244 {
245 string a = (string)_attributes[i];
246 string b = (string)other._attributes[i];
247 if (!string.Equals(a, b))
248 {
249 return false;
250 }
251 }
252 }
253 if (_children == null || other._children == null)
254 {
255 if (_children != other._children)
256 {
257 return false;
258 }
259 }
260 else
261 {
262 if (_children.Count != other._children.Count)
263 {
264 return false;
265 }
266 IEnumerator enumerator = _children.GetEnumerator();
267 IEnumerator enumerator2 = other._children.GetEnumerator();
268 while (enumerator.MoveNext())
269 {
270 enumerator2.MoveNext();
271 SecurityElement securityElement = (SecurityElement)enumerator.Current;
272 SecurityElement other2 = (SecurityElement)enumerator2.Current;
273 if (securityElement == null || !securityElement.Equal(other2))
274 {
275 return false;
276 }
277 }
278 }
279 return true;
280 }
virtual IEnumerator GetEnumerator()

References System.Security.SecurityElement.SecurityElement(), System.Security.SecurityElement._attributes, System.Security.SecurityElement._children, System.Security.SecurityElement._tag, System.Security.SecurityElement._text, System.count, System.Collections.ArrayList.Count, System.Collections.IEnumerator.Current, System.Security.SecurityElement.Equal(), System.Collections.ArrayList.GetEnumerator(), System.Collections.IEnumerator.MoveNext(), and System.other.

Referenced by System.Security.SecurityElement.Equal().