private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { ProgressEventArg arg = new ProgressEventArg(); arg.Worker = backgroundWorker; arg.Tag = _tag; if (DoWork != null) DoWork(this, arg); }
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { ProgressEventArg arg = new ProgressEventArg(); arg.Worker = backgroundWorker; arg.Tag = _tag; if (DoWork != null) { DoWork(this, arg); } }
private void log_ProgressChanged(object sender, ProgressEventArg e) { if (base.InvokeRequired) { base.BeginInvoke((MethodInvoker)(() => { pBarLog.Value = (int)e.Progress; }), null); } else { pBarLog.Value = (int)e.Progress; } }
private void log_ProgressChanged(object sender, ProgressEventArg e) { MethodInvoker method = null; if (base.InvokeRequired) { if (method == null) { method = delegate { this.pBarLog.Value = (int)e.Progress; }; } base.BeginInvoke(method, null); } else { this.pBarLog.Value = (int)e.Progress; } }