private void FFmpeg_Completed(object sender, FFmpeg.CompletedEventArgs e)
 {
     if (manager.AppExited)
     {
         return;
     }
     Dispatcher.Invoke(() => {
         FFmpegProcess Proc = sender as FFmpegProcess;
         if (e.Status == CompletionStatus.Error && !Proc.WorkProcess.StartInfo.FileName.EndsWith("avs2yuv.exe"))
         {
             FFmpegErrorWindow.Instance(Owner, Proc);
         }
         // hosts.Remove(Proc);
         if (Proc == task)
         {
             task = null;
             TaskStatusText.Text = "";
         }
         if (autoClose && !HasRunningHosts)
         {
             ClosingState = 2;
             this.Close();
         }
     });
 }
        public static void Instance(Window parent, FFmpegProcess host)
        {
            FFmpegErrorWindow F = new FFmpegErrorWindow();

            F.Owner           = parent;
            F.Title           = (host.LastCompletionStatus == CompletionStatus.Timeout ? "Timeout: " : "Failed: ") + host.Options.Title;
            F.OutputText.Text = host.CommandWithArgs + Environment.NewLine + Environment.NewLine + host.Output;
            F.Show();
        }
 public override void DisplayError(FFmpegProcess host)
 {
     Application.Current.Dispatcher.Invoke(() => FFmpegErrorWindow.Instance(parent, host));
 }