public RenameConfirmationPopup(IList<DBMovieInfo> movies) { InitializeComponent(); movieRenamer = new MovieRenamer(); // if we are only processing one movie change skip button to "cancel" if (movies.Count == 1) skipButton.Text = "Cancel"; // initialize the rename settings menu items renameFoldersMenuItem.Checked = MovingPicturesCore.Settings.RenameFolders; renameFilesMenuItem.Checked = MovingPicturesCore.Settings.RenameFiles; renameSecondaryFilesMenuItem.Checked = MovingPicturesCore.Settings.RenameSecondaryFiles; UpdateConfigControls(); // initialize the movie enumerator this.movies = movies; remaining = movies.Count; movieEnumerator = movies.GetEnumerator(); }
private void RevertRenamesWorker(ProgressDelegate progress) { MovieRenamer renamer = new MovieRenamer(); int total = processingMovies.Count; int processed = 0; int percentDone = 0; foreach(DBMovieInfo currMovie in processingMovies) { percentDone = (int)Math.Round(100.0 * (processed) / total); bool available = currMovie.LocalMedia.IsAvailable(); bool isDisk = currMovie.LocalMedia[0].ImportPath.IsOpticalDrive; if (available && !isDisk) { progress("Reverting " + currMovie.Title + "...", percentDone); renamer.Revert(currMovie); } processed++; } progress("Done!", 100); }