Show / Hide Table of Contents

Class ListViewItemComparer

An abstract class for creating an System.Collections.IComparer to compare the items of a System.Windows.Controls.ListView.

Inheritance
System.Object
ListViewItemComparer
Implements
System.Collections.IComparer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Controls
Assembly: Phoenix.Controls.dll
Syntax
public abstract class ListViewItemComparer : IComparer

Constructors

View Source

ListViewItemComparer(ListSortDirection)

Initializes a new instance of the ListViewItemComparer class, and sets the default sort direction.

Declaration
protected ListViewItemComparer(ListSortDirection listSortDirection)
Parameters
Type Name Description
System.ComponentModel.ListSortDirection listSortDirection

The sort direction.

Methods

View Source

Compare(Object, Object)

Compares two objects, if the list sort direction is Ascending, it calls CompareObjects(Object, Object) in two modes -If the System.ComponentModel.ListSortDirection is set to Ascending and passes in object x first, y second. -If the System.ComponentModel.ListSortDirection is set to Descending and passes in object y first, x second.

Declaration
public int Compare(object x, object y)
Parameters
Type Name Description
System.Object x

First object.

System.Object y

Second object.

Returns
Type Description
System.Int32

Number that represents the comparison order.

View Source

CompareObjects(Object, Object)

Abstract method which is called by Compare(Object, Object), which does that actual compare between the objects.

Declaration
protected abstract int CompareObjects(object value1, object value2)
Parameters
Type Name Description
System.Object value1

First object

System.Object value2

Second object.

Returns
Type Description
System.Int32

Number that represents the comparison order. Less than zero: x precedes y, zero: x occurs in same position as y, greater than 0: x follows y.

Implements

System.Collections.IComparer
  • View Source
In This Article
Back to top Generated by DocFX