Пример #1
0
        private void RemoveCollectionButton_Click(object sender, EventArgs e)
        {
            SoundPlayer.PlayRemovePlayerSound();
            var confirm = GetConfirmStatus("Удалить коллекцию?");

            if (confirm.Yes)
            {
                var collectionName = CategoryComboBox.Text;
                libManager.RemoveCategory(collectionName);
                var categories = libManager.GetCategories();
                this.Invoke((Action)(() => CategoryComboBox.DataSource = categories.ToList()));
                this.Invoke((Action)(() => CategoryComboBox.Refresh()));
                fileManager.DeleteCollection(collectionName, libManager.LibraryPath);
            }

            confirm.Dispose();
            this.Enabled = true;
        }