public void NotifyRegistered(CopyEvent copyInfo) { lock(_eventList) { _eventList.AsParallel() .ForAll(x => x.Notify(copyInfo)); } }
public void Notify(CopyEvent info) { this.ReportProgress(info); }
private void ReportProgress(CopyEvent info) { if (InvokeRequired) { BeginInvoke(new Action(delegate { ReportProgress(info); })); return; } this.progressBar1.PerformStep(); richTextBox1.AppendText(string.Format("Copied='{2}' {0} => {1} ", info.Source, info.Dest, info.Copied)); richTextBox1.SelectionStart = richTextBox1.Text.Length; richTextBox1.ScrollToCaret(); }