Optimize deleting all images

This commit is contained in:
Ben Olden-Cooligan 2020-01-29 11:54:57 -05:00
parent 44b66eb733
commit 50fdada34d

View File

@ -601,10 +601,17 @@ namespace NAPS2.WinForms
set
{
disableSelectedIndexChangedEvent = true;
thumbnailList1.SelectedIndices.Clear();
foreach (int i in value)
if (imageList.Images.Count == 0)
{
thumbnailList1.SelectedIndices.Add(i);
thumbnailList1.Clear();
}
else
{
thumbnailList1.SelectedIndices.Clear();
foreach (int i in value)
{
thumbnailList1.SelectedIndices.Add(i);
}
}
disableSelectedIndexChangedEvent = false;
thumbnailList1_SelectedIndexChanged(thumbnailList1, new EventArgs());