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

◆ Compare() [1/2]

int MS.Internal.Xml.XPath.XPathComparerHelper.Compare ( object x,
object y )
inline

Definition at line 53 of file XPathComparerHelper.cs.

54 {
55 switch (_dataType)
56 {
57 case XmlDataType.Text:
58 {
59 string @string = Convert.ToString(x, _cinfo);
60 string string2 = Convert.ToString(y, _cinfo);
61 int num2 = _cinfo.CompareInfo.Compare(@string, string2, (_caseOrder != 0) ? CompareOptions.IgnoreCase : CompareOptions.None);
62 if (num2 != 0 || _caseOrder == XmlCaseOrder.None)
63 {
64 if (_order != XmlSortOrder.Ascending)
65 {
66 return -num2;
67 }
68 return num2;
69 }
71 if (_caseOrder != XmlCaseOrder.LowerFirst)
72 {
73 return -num2;
74 }
75 return num2;
76 }
77 case XmlDataType.Number:
78 {
79 double num = XmlConvert.ToXPathDouble(x);
80 double value = XmlConvert.ToXPathDouble(y);
81 int num2 = num.CompareTo(value);
82 if (_order != XmlSortOrder.Ascending)
83 {
84 return -num2;
85 }
86 return num2;
87 }
88 default:
90 }
91 }
static ? string ToString(object? value)
Definition Convert.cs:2321
int Compare(string? string1, string? string2)
virtual CompareInfo CompareInfo
static string Xml_InvalidOperation
Definition SR.cs:18
Definition SR.cs:7
static double ToXPathDouble(object o)

References MS.Internal.Xml.XPath.XPathComparerHelper._caseOrder, MS.Internal.Xml.XPath.XPathComparerHelper._cinfo, MS.Internal.Xml.XPath.XPathComparerHelper._dataType, MS.Internal.Xml.XPath.XPathComparerHelper._order, System.Globalization.CompareInfo.Compare(), System.Globalization.CultureInfo.CompareInfo, System.Xml.Dictionary, System.Convert.ToString(), System.Xml.XmlConvert.ToXPathDouble(), System.value, and System.SR.Xml_InvalidOperation.