Table of Contents

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

int

Order

The SortOrder used in the comparison.
public SortOrder Order { get; set; }

Property Value

SortOrder

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

x object
The first object to compare.
y object
The second object to compare.

Returns

int
A signed integer that indicates the relative values of x and y:
- If less than 0, x is less than y.
- If 0, x equals y.
- If greater than 0, x is greater than y.

Exceptions

ArgumentException
Neither x nor y implements the IComparable interface. -or- x and y are of different types and neither one can handle comparisons with the other.