Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathNavigatorKeyComparer.cs
Go to the documentation of this file.
1
using
System.Collections
;
2
using
MS.Internal.Xml.Cache
;
3
4
namespace
System.Xml.XPath
;
5
6
internal
sealed
class
XPathNavigatorKeyComparer
:
IEqualityComparer
7
{
8
bool
IEqualityComparer
.
Equals
(
object
obj1
,
object
obj2
)
9
{
10
XPathNavigator
xPathNavigator
=
obj1
as
XPathNavigator
;
11
XPathNavigator
xPathNavigator2
=
obj2
as
XPathNavigator
;
12
if
(
xPathNavigator
!=
null
&&
xPathNavigator2
!=
null
&&
xPathNavigator
.IsSamePosition(
xPathNavigator2
))
13
{
14
return
true
;
15
}
16
return
false
;
17
}
18
19
int
IEqualityComparer
.
GetHashCode
(
object
obj
)
20
{
21
if
(
obj
==
null
)
22
{
23
throw
new
ArgumentNullException
(
"obj"
);
24
}
25
if
(
obj
is
XPathDocumentNavigator
xPathDocumentNavigator
)
26
{
27
return
xPathDocumentNavigator
.GetPositionHashCode();
28
}
29
if
(
obj
is
XPathNavigator
xPathNavigator
)
30
{
31
object
underlyingObject
=
xPathNavigator
.UnderlyingObject;
32
if
(
underlyingObject
!=
null
)
33
{
34
return
underlyingObject
.GetHashCode();
35
}
36
int
nodeType = (int)
xPathNavigator
.NodeType;
37
nodeType ^=
xPathNavigator
.LocalName.GetHashCode();
38
nodeType ^=
xPathNavigator
.Prefix.GetHashCode();
39
return
nodeType ^
xPathNavigator
.NamespaceURI.GetHashCode();
40
}
41
return
obj
.GetHashCode();
42
}
43
}
MS.Internal.Xml.Cache.XPathDocumentNavigator
Definition
XPathDocumentNavigator.cs:9
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.Xml.XPath.XPathNavigatorKeyComparer
Definition
XPathNavigatorKeyComparer.cs:7
System.Xml.XPath.XPathNavigator
Definition
XPathNavigator.cs:15
System.Collections.IEqualityComparer.Equals
new bool Equals(object? x, object? y)
System.Collections.IEqualityComparer.GetHashCode
int GetHashCode(object obj)
System.Collections.IEqualityComparer
Definition
IEqualityComparer.cs:4
MS.Internal.Xml.Cache
Definition
TextBlockType.cs:1
System.Collections
Definition
BlockingCollection.cs:8
System.Xml.XPath
Definition
Extensions.cs:5
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.obj
@ obj
source
System.Private.Xml
System.Xml.XPath
XPathNavigatorKeyComparer.cs
Generated by
1.10.0