초기 커밋.
This commit is contained in:
1077
JWH/CONTROL/GridViewEx.cs
Normal file
1077
JWH/CONTROL/GridViewEx.cs
Normal file
File diff suppressed because it is too large
Load Diff
34
JWH/CONTROL/ListViewItemComparer.cs
Normal file
34
JWH/CONTROL/ListViewItemComparer.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JWH.CONTROL
|
||||
{
|
||||
|
||||
public class ListViewItemComparer : IComparer
|
||||
{
|
||||
|
||||
public int Column { get; set; } = 0;
|
||||
public System.Windows.Forms.SortOrder SortOrder { get; set; } = System.Windows.Forms.SortOrder.Ascending;
|
||||
|
||||
public ListViewItemComparer()
|
||||
{
|
||||
}
|
||||
|
||||
public ListViewItemComparer(int column, System.Windows.Forms.SortOrder order = System.Windows.Forms.SortOrder.Ascending)
|
||||
{
|
||||
this.Column = column;
|
||||
this.SortOrder = order;
|
||||
}
|
||||
|
||||
public int Compare(object x, object y)
|
||||
{
|
||||
int rtnValue = -1;
|
||||
rtnValue = String.Compare(((ListViewItem)x).SubItems[this.Column].Text, ((ListViewItem)y).SubItems[this.Column].Text);
|
||||
if (this.SortOrder == System.Windows.Forms.SortOrder.Descending) rtnValue *= -1;
|
||||
return rtnValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user