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 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");
            }
        }
Exemple #3
0
 private void FillFolders()
 {
     ///please insert here to loader query
     folders = PathManager.ReadFromFile();
     lwFolders.ItemsSource = folders;
 }
 private void AddFolderWatch(List <string> AllowedExtensions)
 {
     Watcher.WatchFolder(PathManager.ReadFromFile(), AllowedExtensions, this);
 }