Class ListViewItemComparer
- Namespace
- RadioExt_Helper.utility
- Assembly
- RadioExt-Helper.dll
Custom comparer that compares between two list view items based on the column and sort order.
public class ListViewItemComparer : IComparer
- Inheritance
-
ListViewItemComparer
- Implements
- Inherited Members
Constructors
ListViewItemComparer(int, SortOrder)
Custom comparer that compares between two list view items based on the column and sort order.
public ListViewItemComparer(int column, SortOrder order)
Parameters
column
int- The column index items should be compared in.
order
SortOrder- The SortOrder of the comparison.
Properties
Column
The ListView column index that items reside in.
public int Column { get; }
Property Value
Order
The SortOrder used in the comparison.
public SortOrder Order { get; set; }
Property Value
Methods
Compare(object?, object?)
Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
public int Compare(object? x, object? y)
Parameters
Returns
- int
- A signed integer that indicates the relative values of
x
andy
:
- If less than 0,x
is less thany
.
- If 0,x
equalsy
.
- If greater than 0,x
is greater thany
.
Exceptions
- ArgumentException
- Neither
x
nory
implements the IComparable interface. -or-x
andy
are of different types and neither one can handle comparisons with the other.