protected virtual void OnSpectrographData(SpectrographDataEventArgs e) { if (SpectrographData != null) { SpectrographData(this, e); } }
void source_SpectrographData(object sender, SpectrographDataEventArgs e) { if (InvokeRequired) { BeginInvoke(new EventHandler <SpectrographDataEventArgs>(source_SpectrographData), sender, e); return; } cachedImages.Add(CreateImage(e.Data)); spectrPictureBox.Invalidate(); if (activityToolStripProgressBar.Value < activityToolStripProgressBar.Maximum) { activityToolStripProgressBar.Value++; } else { activityToolStripProgressBar.Value = 0; } }