Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XNodeEqualityComparer.cs
Go to the documentation of this file.
1
using
System.Collections
;
2
using
System.Collections.Generic
;
3
4
namespace
System.Xml.Linq
;
5
6
public
sealed
class
XNodeEqualityComparer
:
IEqualityComparer
,
IEqualityComparer
<XNode>
7
{
8
public
bool
Equals
(
XNode
? x,
XNode
? y)
9
{
10
return
XNode
.
DeepEquals
(x, y);
11
}
12
13
public
int
GetHashCode
(
XNode
obj
)
14
{
15
return
obj
?.GetDeepHashCode() ?? 0;
16
}
17
18
bool
IEqualityComparer
.
Equals
(
object
x,
object
y)
19
{
20
XNode
xNode
= x
as
XNode
;
21
if
(
xNode
==
null
&& x !=
null
)
22
{
23
throw
new
ArgumentException
(
System
.
SR
.
Format
(
System
.
SR
.
Argument_MustBeDerivedFrom
,
typeof
(
XNode
)),
"x"
);
24
}
25
XNode
xNode2
= y
as
XNode
;
26
if
(
xNode2
==
null
&& y !=
null
)
27
{
28
throw
new
ArgumentException
(
System
.
SR
.
Format
(
System
.
SR
.
Argument_MustBeDerivedFrom
,
typeof
(
XNode
)),
"y"
);
29
}
30
return
Equals
(
xNode
,
xNode2
);
31
}
32
33
int
IEqualityComparer
.
GetHashCode
(
object
obj
)
34
{
35
XNode
xNode
=
obj
as
XNode
;
36
if
(
xNode
==
null
&&
obj
!=
null
)
37
{
38
throw
new
ArgumentException
(
System
.
SR
.
Format
(
System
.
SR
.
Argument_MustBeDerivedFrom
,
typeof
(
XNode
)),
"obj"
);
39
}
40
return
GetHashCode
(
xNode
);
41
}
42
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.SR.Format
static string Format(string resourceFormat, object p1)
Definition
SR.cs:118
System.SR.Argument_MustBeDerivedFrom
static string Argument_MustBeDerivedFrom
Definition
SR.cs:28
System.SR
Definition
SR.cs:7
System.Xml.Linq.XNodeEqualityComparer.Equals
bool Equals(XNode? x, XNode? y)
Definition
XNodeEqualityComparer.cs:8
System.Xml.Linq.XNodeEqualityComparer.GetHashCode
int GetHashCode(XNode obj)
Definition
XNodeEqualityComparer.cs:13
System.Xml.Linq.XNodeEqualityComparer
Definition
XNodeEqualityComparer.cs:7
System.Xml.Linq.XNode.DeepEquals
static bool DeepEquals(XNode? n1, XNode? n2)
Definition
XNode.cs:426
System.Xml.Linq.XNode
Definition
XNode.cs:11
System.Collections.Generic.IEqualityComparer.GetHashCode
int GetHashCode([DisallowNull] T obj)
System.Collections.Generic.IEqualityComparer.Equals
bool Equals(T? x, T? y)
System.Collections.Generic.IEqualityComparer
Definition
IEqualityComparer.cs:6
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Collections
Definition
BlockingCollection.cs:8
System.Xml.Linq
Definition
BaseUriAnnotation.cs:1
System.Xml.ExceptionType.ArgumentException
@ ArgumentException
System.ExceptionArgument.obj
@ obj
System
Definition
BlockingCollection.cs:8
source
System.Private.Xml.Linq
System.Xml.Linq
XNodeEqualityComparer.cs
Generated by
1.10.0