private void clearCategoriesListBox()
{
ActiveCheckedListBox.managingLists = true;
var categoriesCheckedItems = categoriesListBox.CheckedItems.Cast<string>().ToList().AsReadOnly();
foreach (string currentCategory in categoriesCheckedItems)
{
string categoryName = AddonProject.Catalog.getListBoxEntryText(currentCategory);
int targetIndex = categoriesListBox.Items.IndexOf(categoriesListBox.Items.Cast<string>()
.Where(itemText => itemText.StartsWith(categoryName))
.First());
categoriesListBox.Items[targetIndex] = categoryName;
categoriesListBox.SetItemChecked(targetIndex, false);
}
ActiveCheckedListBox.managingLists = false;
}
private void clearCatalogListBoxes()