A task that runs in the background
Inheritance: IProgressTask
 /// <summary>
 /// Scans the specified subdirectory for settings.
 /// </summary>
 /// <param name="subdirectory">
 /// The subdirectory. 
 /// </param>
 public void ScanEpisodes(string subdirectory)
 {
     var task = new BackgroundTask(
         () =>
             {
                 this.fileSearch.Search(subdirectory);
                 this.OnPropertyChanged("Results");
             });
     task.Start();
     this.sortView.StartTaskProgress(task, "Scanning episodes");
 }
 /// <summary>
 /// Copies the episodes at the specified indices.
 /// </summary>
 public void CopyEpisodes()
 {
     var task = new BackgroundTask(() => this.fileSearch.Copy());
     task.Start();
     this.sortView.StartTaskProgress(task, "Copying Episodes");
 }
 /// <summary>
 /// Moves the episodes at the specified indices.
 /// </summary>
 public void MoveEpisodes()
 {
     var task = new BackgroundTask(() => this.fileSearch.Move());
     task.Start();
     this.sortView.StartTaskProgress(task, "Moving Episodes");
     this.ScanEpisodes(this.lastSubdirectoryScanned);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Updates the selected show.
        /// </summary>
        public void UpdateSelectedShow()
        {
            var task = new BackgroundTask(
                () =>
                    {
                        if (this.SelectedShow == null)
                        {
                            return;
                        }

                        this.SelectedShow.Update();
                        this.OnPropertyChanged("SelectedShow");
                    });
            task.Start();
            this.tvView.StartTaskProgress(task, "Updating " + this.SelectedShow.Name);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Updates all shows.
        /// </summary>
        public void UpdateAllShows()
        {
            var task = new BackgroundTask(
                () =>
                    {
                        // Only update the unlocked shows.
                        List<TvShow> unlockedShows = this.Shows.Where(x => !x.Locked).ToList();
                        TvShow.UpdateShows(unlockedShows);
                        this.OnPropertyChanged("SelectedShow");
                    });
            task.Start();

            this.tvView.StartTaskProgress(task, "Updating All Shows");
        }
Exemplo n.º 6
0
        /// <summary>
        /// Searches for new shows.
        /// </summary>
        public void SearchShows()
        {
            var task = new BackgroundTask(
                () =>
                    {
                        this.SearchResults = TvShow.SearchNewShows();
                        this.OnSearchShowsComplete();
                    });
            task.Start();

            this.tvView.StartTaskProgress(task, "Searching shows");
        }
Exemplo n.º 7
0
 /// <summary>
 /// The create nfo files.
 /// </summary>
 public void CreateNfoFiles()
 {
     var task = new BackgroundTask(TvShow.CreateNfoFiles);
     task.Start();
     this.tvView.StartTaskProgress(task, "Creating .nfo files.");
 }
        /// <summary>
        /// Refreshes the file counts of the episodes.
        /// </summary>
        public void RefreshFileCounts()
        {
            var task = new BackgroundTask(FileSearch.RefreshFileCounts);
            task.Start();

            this.View.StartTaskProgress(task, "Refreshing file counts");
        }