11 [OptionalField(VersionAdded = 3)]
12 internal string localeName;
14 [OptionalField(VersionAdded = 1)]
15 internal int win32LCID;
19 internal string m_String;
21 internal byte[] m_KeyData;
29 public virtual byte[]
KeyData => (
byte[])m_KeyData.Clone();
34 this.localeName = localeName;
35 this.options = options;
51 if (
string.IsNullOrEmpty(localeName) && win32LCID != 0)
53 localeName = CultureInfo.GetCultureInfo(win32LCID).Name;
68 if (sortkey1 ==
null || sortkey2 ==
null)
72 byte[] keyData = sortkey1.m_KeyData;
73 byte[] keyData2 = sortkey2.m_KeyData;
74 if (keyData.Length == 0)
76 if (keyData2.Length == 0)
82 if (keyData2.Length == 0)
86 int num = (keyData.Length < keyData2.Length) ? keyData.Length : keyData2.Length;
87 for (
int i = 0; i < num; i++)
89 if (keyData[i] > keyData2[i])
93 if (keyData[i] < keyData2[i])
107 public override bool Equals(
object value)
112 return Compare(
this, sortKey) == 0;
128 return "SortKey - " + localeName +
", " + options +
", " + m_String;
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual byte [] KeyData
Gets the byte array representing the current T:System.Globalization.SortKey object.
override string ToString()
Returns a string that represents the current T:System.Globalization.SortKey object.
static CompareInfo GetCompareInfo(int culture, Assembly assembly)
Initializes a new T:System.Globalization.CompareInfo object that is associated with the specified cul...
Describes the source and destination of a given serialized stream, and provides an additional caller-...
static CultureInfo GetCultureInfo(int culture)
Retrieves a cached, read-only instance of a culture by using the specified culture identifier.
override int GetHashCode()
Serves as a hash function for the current T:System.Globalization.SortKey object that is suitable for ...
static int Compare(SortKey sortkey1, SortKey sortkey2)
Compares two sort keys.
Implements a set of methods for culture-sensitive string comparisons.
override bool Equals(object value)
Determines whether the specified object is equal to the current T:System.Globalization....
virtual string OriginalString
Gets the original string used to create the current T:System.Globalization.SortKey object.
Represents the result of mapping a string to its sort key.
Specifies that the class can be serialized.
virtual int LCID
Gets the culture identifier for the current T:System.Globalization.CultureInfo.
Provides information about a specific culture (called a locale for unmanaged code development)....
CompareOptions
Defines the string comparison options to use with T:System.Globalization.CompareInfo.