mscorlib(4.0.0.0) API with additions
InvariantComparer.cs
1 using System.Collections;
3 
4 namespace System
5 {
7  internal class InvariantComparer : IComparer
8  {
9  private CompareInfo m_compareInfo;
10 
11  internal static readonly System.InvariantComparer Default = new System.InvariantComparer();
12 
13  internal InvariantComparer()
14  {
16  }
17 
18  public int Compare(object a, object b)
19  {
20  string text = a as string;
21  string text2 = b as string;
22  if (text != null && text2 != null)
23  {
24  return m_compareInfo.Compare(text, text2);
25  }
26  return Comparer.Default.Compare(a, b);
27  }
28  }
29 }
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
Compares two objects for equivalence, where string comparisons are case-sensitive.
Definition: Comparer.cs:11
virtual CompareInfo? CompareInfo
Gets the T:System.Globalization.CompareInfo that defines how to compare strings for the culture.
Definition: CultureInfo.cs:447
int Compare(object a, object b)
Performs a case-sensitive comparison of two objects of the same type and returns a value indicating w...
Definition: Comparer.cs:64
Definition: __Canon.cs:3
virtual int Compare(string string1, string string2)
Compares two strings.
Definition: CompareInfo.cs:313
static readonly Comparer Default
Represents an instance of T:System.Collections.Comparer that is associated with the P:System....
Definition: Comparer.cs:16
Implements a set of methods for culture-sensitive string comparisons.
Definition: CompareInfo.cs:13
Exposes a method that compares two objects.
Definition: IComparer.cs:8
Specifies that the class can be serialized.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
The default setting for this enumeration, which is currently F:System.GCCollectionMode....