A task that runs in the background
상속: 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);
 }
예제 #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);
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }