Esempio n. 1
0
        private void RemoveFolder_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = _removeMusicFolder.ShowDialog();

            if (dialogResult != DialogResult.Cancel)
            {
                foreach (string path in Directory.GetFiles(_removeMusicFolder.SelectedPath))
                {
                    if (MainForm.AudioExtensions.Contains(Path.GetExtension(path)))
                    {
                        _playlist.TryDeleteSongByPath(path);
                    }
                }

                _filesInPlaylist.Items.Clear();
                _filesInPlaylist.Items.AddRange(_playlist.GetSongsKeys());
            }
        }
Esempio n. 2
0
        public static void DeleteSongsFromFolder(FolderBrowserDialog folderBrowserDialog, ComboBox comboBox, Playlist playlist)
        {
            DialogResult dialogResult = folderBrowserDialog.ShowDialog();

            if (dialogResult != DialogResult.Cancel)
            {
                foreach (string path in Directory.GetFiles(folderBrowserDialog.SelectedPath))
                {
                    if (MainForm.AudioExtensions.Contains(Path.GetExtension(path)))
                    {
                        playlist.TryDeleteSongByPath(path);
                    }
                }

                comboBox.Items.Clear();
                comboBox.Items.AddRange(playlist.GetSongsKeys());
            }
        }