Class Comparer
Represents the class that defines the comparer by implementing the IComparer.
Inheritance
System.Object
Comparer
Implements
System.Collections.IComparer
Namespace: Syncfusion.Maui.Data
Assembly: Syncfusion.Maui.Data.dll
Syntax
public sealed class Comparer : Object, IComparer
Constructors
Comparer(CultureInfo)
Initializes a new instance of the Comparer class.
Declaration
public Comparer(CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | The culture info of the comparer initialized. |
Properties
Default
Gets the default comparer with the culture info as current culture.
Declaration
public static Comparer Default { get; }
Property Value
Type |
---|
Comparer |
DefaultInvariant
Gets the default invariant comparer with the culture info as invariant culture.
Declaration
public static Comparer DefaultInvariant { get; }
Property Value
Type |
---|
Comparer |
Methods
Compare(Object, Object)
Compares the given two objects.
Declaration
public int Compare(object obj1, object obj2)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj1 | The object 1. |
System.Object | obj2 | The object 2. |
Returns
Type | Description |
---|---|
System.Int32 | The value indicating the comparison of the given two objects. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Object should implement IComparable |
Implements
System.Collections.IComparer