remove sorting from list views while reading all
This commit is contained in:
parent
666f91cfd3
commit
12d274ffcc
1 changed files with 31 additions and 0 deletions
|
|
@ -226,10 +226,41 @@ namespace Observatory.UI
|
|||
readAllDialogue.StartPosition = FormStartPosition.Manual;
|
||||
readAllDialogue.Location = Point.Add(Location, new Size(100, 100));
|
||||
SuspendDrawing(this);
|
||||
SuspendSorting();
|
||||
readAllDialogue.ShowDialog();
|
||||
ResumeSorting();
|
||||
ResumeDrawing(this);
|
||||
}
|
||||
|
||||
private Dictionary<PluginListView, object> PluginComparer;
|
||||
|
||||
private void SuspendSorting()
|
||||
{
|
||||
PluginComparer = new();
|
||||
foreach (var panel in uiPanels.Values)
|
||||
{
|
||||
foreach (var control in panel.Controls)
|
||||
{
|
||||
if (control?.GetType() == typeof(PluginListView))
|
||||
{
|
||||
var listView = (PluginListView)control;
|
||||
PluginComparer.Add(listView, listView.ListViewItemSorter);
|
||||
listView.ListViewItemSorter = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ResumeSorting()
|
||||
{
|
||||
if (PluginComparer?.Any() ?? false)
|
||||
foreach (var panel in PluginComparer.Keys)
|
||||
{
|
||||
panel.ListViewItemSorter = (IObservatoryComparer)PluginComparer[panel];
|
||||
}
|
||||
PluginComparer?.Clear();
|
||||
}
|
||||
|
||||
private void PopupNotificationLabel_Click(object _, EventArgs e)
|
||||
{
|
||||
CorePanel.SuspendLayout();
|
||||
|
|
|
|||
Loading…
Reference in a new issue