Skip to content

Commit

Permalink
Merge pull request #134 from GenieClient/Thires-Sortable-Columns
Browse files Browse the repository at this point in the history
Added Column Sorting
  • Loading branch information
mj-colonel-panic authored Dec 1, 2022
2 parents e712ee4 + b3a7858 commit 7b13a29
Show file tree
Hide file tree
Showing 20 changed files with 2,852 additions and 2,426 deletions.
471 changes: 246 additions & 225 deletions Forms/ConfigPanels/UCAliases.Designer.cs

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Forms/ConfigPanels/UCAliases.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Linq;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
Expand Down Expand Up @@ -63,6 +64,28 @@ private void ResetList()
ListViewBase.Columns.Add("Action", 500, HorizontalAlignment.Left);
}

private void ListViewBase_SortColumnClick(object sender, ColumnClickEventArgs e)
{
_ListViewBase.Sorting = System.Windows.Forms.SortOrder.None;

if (ListViewBase.Tag == null || (int)ListViewBase.Tag > 0)
{
ListViewItem[] tmp = ListViewBase.Items.Cast<ListViewItem>().OrderBy(t => t.SubItems[e.Column].Text).ToArray();
ListViewBase.Items.Clear();
ListViewBase.Items.AddRange(tmp);

ListViewBase.Tag = -1;
}
else
{
ListViewItem[] tmp = ListViewBase.Items.Cast<ListViewItem>().OrderByDescending(t => t.SubItems[e.Column].Text).ToArray();
ListViewBase.Items.Clear();
ListViewBase.Items.AddRange(tmp);

ListViewBase.Tag = +1;
}
}

private void ToolStripButtonRefresh_Click(object sender, EventArgs e)
{
PopulateList();
Expand Down
470 changes: 245 additions & 225 deletions Forms/ConfigPanels/UCClasses.Designer.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Forms/ConfigPanels/UCClasses.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Linq;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
Expand Down
851 changes: 443 additions & 408 deletions Forms/ConfigPanels/UCHighlightStrings.Designer.cs

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Forms/ConfigPanels/UCHighlightStrings.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
Expand Down Expand Up @@ -295,6 +296,28 @@ private void ResetList()
ListViewBase.Columns.Add("Class", 100, HorizontalAlignment.Left);
}

private void ListViewBase_SortColumnClick(object sender, ColumnClickEventArgs e)
{
_ListViewBase.Sorting = System.Windows.Forms.SortOrder.None;

if (ListViewBase.Tag == null || (int)ListViewBase.Tag > 0)
{
ListViewItem[] tmp = ListViewBase.Items.Cast<ListViewItem>().OrderBy(t => t.SubItems[e.Column].Text).ToArray();
ListViewBase.Items.Clear();
ListViewBase.Items.AddRange(tmp);

ListViewBase.Tag = -1;
}
else
{
ListViewItem[] tmp = ListViewBase.Items.Cast<ListViewItem>().OrderByDescending(t => t.SubItems[e.Column].Text).ToArray();
ListViewBase.Items.Clear();
ListViewBase.Items.AddRange(tmp);

ListViewBase.Tag = +1;
}
}

private void ToolStripButtonRefresh_Click(object sender, EventArgs e)
{
PopulateList();
Expand Down
475 changes: 248 additions & 227 deletions Forms/ConfigPanels/UCIgnore.Designer.cs

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Forms/ConfigPanels/UCIgnore.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Linq;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
Expand Down Expand Up @@ -104,6 +105,28 @@ private void ResetList()
ListViewBase.Columns.Add("Class", 100, HorizontalAlignment.Left);
}

private void ListViewBase_SortColumnClick(object sender, ColumnClickEventArgs e)
{
_ListViewBase.Sorting = System.Windows.Forms.SortOrder.None;

if (ListViewBase.Tag == null || (int)ListViewBase.Tag > 0)
{
ListViewItem[] tmp = ListViewBase.Items.Cast<ListViewItem>().OrderBy(t => t.SubItems[e.Column].Text).ToArray();
ListViewBase.Items.Clear();
ListViewBase.Items.AddRange(tmp);

ListViewBase.Tag = -1;
}
else
{
ListViewItem[] tmp = ListViewBase.Items.Cast<ListViewItem>().OrderByDescending(t => t.SubItems[e.Column].Text).ToArray();
ListViewBase.Items.Clear();
ListViewBase.Items.AddRange(tmp);

ListViewBase.Tag = +1;
}
}

private void ToolStripButtonRefresh_Click(object sender, EventArgs e)
{
PopulateList();
Expand Down
Loading

0 comments on commit 7b13a29

Please sign in to comment.