private void worker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (((BackgroundWorker)sender).WorkerReportsProgress) { if (prCurrent.IsIndeterminate) { prCurrent.IsIndeterminate = false; text_info.Content = Languages.Translate("Indexing") + " (FFMS2)..."; } prCurrent.Value = e.ProgressPercentage; if (total > 1) { Title = e.ProgressPercentage.ToString("0") + "% (" + (current + 1) + " of " + total + ")"; } else { Title = "(" + e.ProgressPercentage.ToString("0") + "%)"; } //Прогресс в Taskbar //if (Handle == IntPtr.Zero) Handle = new WindowInteropHelper(this).Handle; Win7Taskbar.SetProgressValue(Handle, Convert.ToUInt64(e.ProgressPercentage), 100); } }
private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e) { if (((BackgroundWorker)sender).WorkerReportsProgress) { if (progress_total.IsIndeterminate) { progress_total.IsIndeterminate = false; label_info.Content = Languages.Translate("Detecting interlace") + "..."; } progress_total.Value = e.ProgressPercentage; Title = "(" + e.ProgressPercentage.ToString("0") + "%)"; //Прогресс в Taskbar //if (Handle == IntPtr.Zero) Handle = new WindowInteropHelper(this).Handle; Win7Taskbar.SetProgressValue(Handle, Convert.ToUInt64(e.ProgressPercentage), 100); } }
private void worker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { if (((BackgroundWorker)sender).WorkerReportsProgress) { if (prCurrent.IsIndeterminate) { prCurrent.IsIndeterminate = false; text_info.Content = Languages.Translate("Volume gain detecting..."); } //получаем текущий фрейм double cf = prCurrent.Value = e.ProgressPercentage; //вычисляем проценты прогресса double pr = (cf / vtrim) * 100.0; Title = "(" + pr.ToString("0") + "%)"; //Прогресс в Taskbar //if (Handle == IntPtr.Zero) Handle = new WindowInteropHelper(this).Handle; Win7Taskbar.SetProgressValue(Handle, Convert.ToUInt64(e.ProgressPercentage), Convert.ToUInt64(vtrim)); } }
private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e) { if (((BackgroundWorker)sender).WorkerReportsProgress) { if (progress_total.IsIndeterminate) { label = label.Replace("YY", total.ToString()); progress_total.IsIndeterminate = false; progress_total.Maximum = total; } Title = "(" + ((e.ProgressPercentage * 100) / total).ToString("0") + "%)"; label_info.Content = label.Replace("XX", e.ProgressPercentage.ToString()); progress_total.Value = e.ProgressPercentage; TimeSpan time = ((DateTime)e.UserState) - start; label_fps.Content = elapsed + (new DateTime(time.Ticks).ToString("HH:mm:ss.ff")) + " avg fps: " + (e.ProgressPercentage / time.TotalSeconds).ToString("0.00", CultureInfo.InvariantCulture); //Прогресс в Taskbar //if (Handle == IntPtr.Zero) Handle = new WindowInteropHelper(this).Handle; Win7Taskbar.SetProgressValue(Handle, Convert.ToUInt64(e.ProgressPercentage), Convert.ToUInt64(total)); } }