-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListViewColumnSorter.cs
46 lines (40 loc) · 1.31 KB
/
ListViewColumnSorter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Decompiled with JetBrains decompiler
// Type: OculusTrayTool.ListViewColumnSorter
// Assembly: OculusTrayTool, Version=0.87.8.0, Culture=neutral, PublicKeyToken=null
// MVID: E8946A27-16D6-4BF6-9D7B-70CB25A977E0
// Assembly location: C:\Program Files (x86)\Oculus Tray Tool\OculusTrayTool.exe
using System.Collections;
using System.Windows.Forms;
#nullable disable
namespace OculusTrayTool
{
public class ListViewColumnSorter : IComparer
{
private int ColumnToSort;
private SortOrder OrderOfSort;
private CaseInsensitiveComparer ObjectCompare;
public ListViewColumnSorter()
{
this.ColumnToSort = 0;
this.OrderOfSort = SortOrder.None;
this.ObjectCompare = new CaseInsensitiveComparer();
}
public int Compare(object x, object y)
{
int num = this.ObjectCompare.Compare((object) ((ListViewItem) x).SubItems[this.ColumnToSort].Text, (object) ((ListViewItem) y).SubItems[this.ColumnToSort].Text);
if (this.OrderOfSort == SortOrder.Ascending)
return num;
return this.OrderOfSort == SortOrder.Descending ? checked (-num) : 0;
}
public int SortColumn
{
get => this.ColumnToSort;
set => this.ColumnToSort = value;
}
public SortOrder Order
{
get => this.OrderOfSort;
set => this.OrderOfSort = value;
}
}
}