public DisplayResults(Mp4RepairJob mp4RepairJob) { InitializeComponent(); mp4RepairJob.FileListUpdated += new FileListUpdatedEventHandler(HandleUpdatedFileList); mp4RepairJob.JobComplete += new JobCompleteEventHandler(HandleJobComplete); this.Show(); Run(mp4RepairJob); }
private async void Run(Mp4RepairJob mp4RepairJob) { var progress = new Progress<JobResult>(UpdateProgress); await Task.Run(() => mp4RepairJob.RunAsync(progress)); }
private Mp4RepairJob PrepareRepairJob() { string sourcePath = String.Empty; Dimension orginalDimensions = new Dimension(0, 0); Dimension actualDimensions = new Dimension(0, 0); FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, string.Empty); if (ValidateMp4RepairJob()) { sourcePath = this.txtSourcePath.Text; orginalDimensions = new Dimension(this.txtOriginalDimensionsWidth.Text.ToUInt16(), this.txtOriginalDimensionsHeight.Text.ToUInt16()); actualDimensions = new Dimension(this.txtActualDimensionsWidth.Text.ToUInt16(), this.txtActualDimensionsHeight.Text.ToUInt16()); fileSaveRule = new FileSaveRule(this.txtFilenamePrefix.Text, this.txtFilenameSuffix.Text, this.txtDestinationPath.Text.AppendBackslashIfNecessary()); } Mp4RepairJob mp4RepairJob = new Mp4RepairJob(sourcePath, orginalDimensions, actualDimensions, fileSaveRule); return mp4RepairJob; }