C# Class ZForge.Controls.XPTable.Sorting.SorterBase

Base class for the sorters used to sort the Cells contained in a TableModel
Exibir arquivo Open project: zhuangyy/Motion

Public Methods

Method Description
Sort ( ) : void

Starts sorting the Cells in the TableModel

SorterBase ( TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder ) : System

Initializes a new instance of the SorterBase class with the specified TableModel, Column index, IComparer and SortOrder

Protected Methods

Method Description
Compare ( Row row1, Row row2 ) : int

Compares two rows and returns a value indicating whether one is less than, equal to or greater than the other. Takes into account the sort order.

CompareRows ( Row row1, Row row2 ) : int

Compares two rows and returns a value indicating whether one is less than, equal to or greater than the other. Compares the given rows without considering parent/sub-rows.

CompareRows ( Row row1, Row row2, int column, IComparer comparer ) : int

Compares two rows and returns a value indicating whether one is less than, equal to or greater than the other. Compares the given rows without considering parent/sub-rows.

Set ( int a, Row row ) : void

Replaces the Row in the TableModel located at index a with the specified Row

Set ( int a, int b ) : void

Replaces the Row in the TableModel located at index a with the Row located at index b

Swap ( int a, int b ) : void

Swaps the Rows in the TableModel at the specified indexes

Method Details

Compare() protected method

Compares two rows and returns a value indicating whether one is less than, equal to or greater than the other. Takes into account the sort order.
protected Compare ( Row row1, Row row2 ) : int
row1 ZForge.Controls.XPTable.Models.Row First row to compare
row2 ZForge.Controls.XPTable.Models.Row Second row to compare
return int

CompareRows() protected method

Compares two rows and returns a value indicating whether one is less than, equal to or greater than the other. Compares the given rows without considering parent/sub-rows.
protected CompareRows ( Row row1, Row row2 ) : int
row1 ZForge.Controls.XPTable.Models.Row
row2 ZForge.Controls.XPTable.Models.Row
return int

CompareRows() protected method

Compares two rows and returns a value indicating whether one is less than, equal to or greater than the other. Compares the given rows without considering parent/sub-rows.
protected CompareRows ( Row row1, Row row2, int column, IComparer comparer ) : int
row1 ZForge.Controls.XPTable.Models.Row
row2 ZForge.Controls.XPTable.Models.Row
column int
comparer IComparer
return int

Set() protected method

Replaces the Row in the TableModel located at index a with the specified Row
protected Set ( int a, Row row ) : void
a int The index of the Row that will be replaced
row ZForge.Controls.XPTable.Models.Row The Row that will be moved to index a
return void

Set() protected method

Replaces the Row in the TableModel located at index a with the Row located at index b
protected Set ( int a, int b ) : void
a int The index of the Row that will be replaced
b int The index of the Row that will be moved to index a
return void

Sort() public abstract method

Starts sorting the Cells in the TableModel
public abstract Sort ( ) : void
return void

SorterBase() public method

Initializes a new instance of the SorterBase class with the specified TableModel, Column index, IComparer and SortOrder
public SorterBase ( TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder ) : System
tableModel ZForge.Controls.XPTable.Models.TableModel The TableModel that contains the data to be sorted
column int The index of the Column to be sorted
comparer IComparer The IComparer used to sort the Column's Cells
sortOrder SortOrder Specifies how the Column is to be sorted
return System

Swap() protected method

Swaps the Rows in the TableModel at the specified indexes
protected Swap ( int a, int b ) : void
a int The index of the first Row to be swapped
b int The index of the second Row to be swapped
return void