Exemple #1
0
        // TODO: Write full implementation
        public void Rename(CancellationToken cancellationToken, Job job)
        {
            Host.ReportProgress(this, 0.0, "Auto-renaming output file...");

            var namer = new FileNamer(job, Preferences);

            job.OutputPath = namer.GetPath().FullName;

            Host.ReportProgress(this, 100.0, "Renamed output file", "Finished auto-renaming output file");
        }
Exemple #2
0
        // TODO: Write full implementation
        public void Rename(CancellationToken cancellationToken, Job job)
        {
            Host.ReportProgress(this, 0.0, "Auto-renaming output file...");

            var namer = new FileNamer(job, Preferences);

            job.OutputPath = namer.GetPath().FullName;

            Host.ReportProgress(this, 100.0, "Finished auto-renaming output file");
        }
        private void OnChanged(FileNamer movieNamer, FileNamer tvShowNamer)
        {
            if (_ignoreChange)
            {
                return;
            }

            _ignoreChange = true;

            // Movies

            _prefsCopy.Movies.Directory = textBoxMovieDirectory.Text;
            _prefsCopy.Movies.FileName  = textBoxMovieFileName.Text;

            var moviePath = movieNamer.GetPath();

            textBoxMovieDirectoryExample.Text = moviePath.Directory;
            textBoxMovieFileNameExample.Text  = moviePath.FileName;

            // TV Shows

            _prefsCopy.TVShows.Directory           = textBoxTVShowDirectory.Text;
            _prefsCopy.TVShows.FileName            = textBoxTVShowFileName.Text;
            _prefsCopy.TVShows.SeasonNumberFormat  = S2NF(comboBoxSeasonNumberFormat.SelectedItem as string);
            _prefsCopy.TVShows.EpisodeNumberFormat = S2NF(comboBoxEpisodeNumberFormat.SelectedItem as string);
            _prefsCopy.TVShows.ReleaseDateFormat   = textBoxTVShowReleaseDateFormat.Text;

            var tvShowPath = tvShowNamer.GetPath();

            textBoxTVShowDirectoryExample.Text = tvShowPath.Directory;
            textBoxTVShowFileNameExample.Text  = tvShowPath.FileName;

            // Save/revert/default buttons

            var hasChanged = !_prefsCopy.Equals(_userPrefs);
            var isDefault  = _prefsCopy.Equals(new Preferences());

            buttonRevert.Enabled  = hasChanged;
            buttonDefault.Enabled = !isDefault;
            buttonSave.Enabled    = hasChanged;

            _ignoreChange = false;
        }
        private void OnChanged(FileNamer movieNamer, FileNamer tvShowNamer)
        {
            if (_ignoreChange) return;

            _ignoreChange = true;

            // Movies

            _prefsCopy.Movies.Directory = textBoxMovieDirectory.Text;
            _prefsCopy.Movies.FileName = textBoxMovieFileName.Text;

            var moviePath = movieNamer.GetPath();

            textBoxMovieDirectoryExample.Text = moviePath.Directory;
            textBoxMovieFileNameExample.Text = moviePath.FileName;

            // TV Shows

            _prefsCopy.TVShows.Directory = textBoxTVShowDirectory.Text;
            _prefsCopy.TVShows.FileName = textBoxTVShowFileName.Text;
            _prefsCopy.TVShows.SeasonNumberFormat = S2NF(comboBoxSeasonNumberFormat.SelectedItem as string);
            _prefsCopy.TVShows.EpisodeNumberFormat = S2NF(comboBoxEpisodeNumberFormat.SelectedItem as string);
            _prefsCopy.TVShows.ReleaseDateFormat = textBoxTVShowReleaseDateFormat.Text;

            var tvShowPath = tvShowNamer.GetPath();

            textBoxTVShowDirectoryExample.Text = tvShowPath.Directory;
            textBoxTVShowFileNameExample.Text = tvShowPath.FileName;

            // Save/revert/default buttons

            var hasChanged = !_prefsCopy.Equals(_userPrefs);
            var isDefault = _prefsCopy.Equals(new Preferences());

            buttonRevert.Enabled = hasChanged;
            buttonDefault.Enabled = !isDefault;
            buttonSave.Enabled = hasChanged;

            _ignoreChange = false;
        }