internal void GetFilesFromFolders() { SelectedIndexListView = 0; List <string> folders = PathManager.ReadFromFile(); List <string> AllowedExtensions = new List <string> { ".mp3", ".jpg", ".mp4", ".avi", ".png" }; //need query form DB FilesFromFolders = null; FilesFromFolders = Scanner.GetFiles(folders, AllowedExtensions); FilesFromFolders2 = FilesFromFolders; FillFilesToListView(); AddFolderWatch(AllowedExtensions); MedCont = new MediaPlayerController(this, myMedia, FilesFromFolders, 0); PathManager.SaveToFile(folders); }
private void btRemoveFolder_Click(object sender, RoutedEventArgs e) { if (folders.Count > 0 && SelectedSomething) { folders.RemoveAt(SelectedItem); PathManager.SaveToFile(folders); this.Close(); MessageBox.Show("Folder Removed"); } else { MessageBox.Show("Nothing to Remove"); } MainForm.FileListView.ItemsSource = null; MainForm.FileListView.Items.Clear(); MainForm.GetFilesFromFolders(); }
private void btAddFolder_Click(object sender, RoutedEventArgs e) { this.save = true; List <string> folders = PathManager.ReadFromFile(); if (!folders.Contains(tbPath.Text)) { folders.Add(tbPath.Text); PathManager.SaveToFile(folders); this.Close(); MainForm.FileListView.ItemsSource = null; MainForm.FileListView.Items.Clear(); MainForm.GetFilesFromFolders(); } else { System.Windows.MessageBox.Show("This folder is already watched"); } }