AddonManager.MainForm.clearCategoriesListBox C# (CSharp) Метод

clearCategoriesListBox() приватный Метод

private clearCategoriesListBox ( ) : void
Результат void
        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()