private void clearProductsListBox()
{
ActiveCheckedListBox.managingLists = true;
var productsCheckedItems = productsListBox.CheckedItems.Cast<string>().ToList().AsReadOnly();
foreach (string currentProduct in productsCheckedItems)
{
string productName = AddonProject.Catalog.getListBoxEntryText(currentProduct);
int targetIndex = productsListBox.Items.IndexOf(productsListBox.Items.Cast<string>()
.Where(itemText => itemText.StartsWith(productName))
.First());
productsListBox.Items[targetIndex] = productName;
productsListBox.SetItemChecked(targetIndex, false);
}
ActiveCheckedListBox.managingLists = false;
}
private void clearCategoriesListBox()