void OnImportProgressChanged(object sender, ProgressChangedArgs args) { switch (args.ImportStatus) { case ProgressStatus.Starting: var step = args.TotalItems > 0 ? 100 / args.TotalItems : 0; Invoke((Action)(() => progressBar1.Step = step)); break; case ProgressStatus.Processing: Invoke((Action)(() => progressBar1.PerformStep())); break; case ProgressStatus.Completed: Invoke((Action)(() => progressBar1.Value = 100)); Invoke((Action)(() => btnImport.Text = "Start Import")); Application.DoEvents(); break; } Invoke((Action)(() => progressBar1.Text = args.ProgressMessage)); if (!string.IsNullOrEmpty(args.ErrorMessage)) { Invoke((Action)(() => MessageBox.Show(args.ErrorMessage, "Error", MessageBoxButtons.OK))); } }
internal void InvokeOnProgressChanged(ProgressChangedArgs args) { var handler = OnProgressChanged; if (handler != null) { handler(this, args); } }
private void OnProgressChanged(IntPtr converter) { var eventArgs = new ProgressChangedArgs { Document = _processingDocument, Description = _wkHtmlToPdf.GetProgressString(converter) }; ProgressChanged?.Invoke(this, eventArgs); }
private void OnProgressChanged(IntPtr converter) { var eventArgs = new ProgressChangedArgs() { Document = ProcessingDocument, Description = Tools.GetProgressString(converter) }; ProgressChanged?.Invoke(this, eventArgs); }
void writer_ProgressChanged(object sender, ProgressChangedArgs e) { if (e.Progress >= 0 && e.Progress <= 100) { SetProgress(e.Progress); } if (!string.IsNullOrWhiteSpace(e.Msg)) { AppendText(e.Msg); } }
protected void OnProgressChanged(ProgressChangedArgs e) { if (ProgressChanged != null) { ProgressChanged(this, e); } else { // do not know what to do; } }
private void BgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { progressBar1.Value = e.ProgressPercentage; ProgressChangedArgs args = (ProgressChangedArgs)e.UserState; infoLbl.Text = LangManager.GetString("progressionLbl") + " " + e.ProgressPercentage.ToString() + "% - " + args.State; if (args.ProcessingPath != "") { infoLbl.Text += Environment.NewLine + LangManager.GetString("processingLbl") + " " + args.ProcessingPath; } }
private void Progressable_ProgressChanged(object sender, ProgressChangedArgs e) { if (Visible) { Invoke((MethodInvoker) delegate { if (progressBar_Progress.Value == e.Progress) { return; } if (e.Progress < 100) { progressBar_Progress.Value = e.Progress + 1; } progressBar_Progress.Value = e.Progress; }); } }
private void Executor_ProgressChanged(Object sender, ProgressChangedArgs e) { if (taskProgressBar.InvokeRequired) //This if else will check if you are on the same thread or not and go from there { MethodInvoker invoker = new MethodInvoker( //Anonymous function/method delegate() { taskProgressBar.Value = e.Progress; }); //taskProgressBar.Invoke(invoker); taskProgressBar.BeginInvoke(invoker); } else { taskProgressBar.Value = e.Progress; } }
private void Progressable_ProgressChanged(object sender, ProgressChangedArgs e) { if (Visible) { Invoke((MethodInvoker) delegate { if (progressBar_Progress.Value == e.Progress) { return; } if (e.Progress < 100) { progressBar_Progress.Value = e.Progress + 1; } progressBar_Progress.Value = e.Progress; if (e.Progress % 25 == 0) { vmuBox.Image = Resources.load[m_random.Next(0, Resources.load.Count)]; } }); } }
void reader_ProgressChanged(object sender, ProgressChangedArgs e) { if (e.Progress >= 0 && e.Progress <= 100) { SetProgress(e.Progress); } if (!string.IsNullOrWhiteSpace(e.Msg)) { AppendText(e.Msg); } }
private static void Converter_ProgressChanged(object sender, ProgressChangedArgs e) { Console.WriteLine("Progress changed {0}", e.Description); }
private void InitializeTaskFatory_ProgressChanged(object sender, ProgressChangedArgs e) { CurrentProgress = e.Progress; }
protected virtual void OnDownloadProgressChanged(ProgressChangedArgs progressChangedArgs) { this.DownloadProgressChanged?.Invoke(this, progressChangedArgs); }
private void PortScanner_ProgressChanged(object sender, ProgressChangedArgs e) { PortsScanned = e.Value; }
protected virtual void OnUpgradeProgressChanged(ProgressChangedArgs progressChangedArgs) { this.UpgradeProgressChanged?.Invoke(this, progressChangedArgs); }
private void IpScanner_ProgressChanged(object sender, ProgressChangedArgs e) { IPAddressesScanned = e.Value; }
private void ProgressChanged(object sender, ProgressChangedArgs e) { Text = $"Registry Editor | Collecting Data from {e.Hive}"; Console.WriteLine(e.Message); }
private static void ConverterOnProgressChanged(object sender, ProgressChangedArgs progressChangedArgs) { OnProgressChangedEvent?.Invoke(progressChangedArgs.Description); }
protected virtual void OnProgressChanged(object sender, ProgressChangedArgs e) => ProgressChanged?.Invoke(sender, e);