public void CreateBackground(DataEventArgs e) { BackgroundWorker task = new BackgroundWorker(); task.RunWorkerCompleted += Finished; task.DoWork += (s, args) => { Handling(e.Data, e.Board); }; task.RunWorkerAsync(); }
public void SplitData(object sender, DoWorkEventArgs e) { lock (thisLock) { ULStat = MccDaq.MccService.WinBufToArray(MemHandle, adData, 0, qChans * NumPoints); BoardErrorException.TestException(ULStat, this, "Reading the buffer"); DataEventArgs args = new DataEventArgs(); args.Data = adData; args.Board = Board; OnScanned(args); } }
private void DispatchData(object sender, DataEventArgs e) { if (maxPontos > 0 && pontos >= maxPontos) { Stop(); uiDispatcher.Invoke(() => { OnFinished(EventArgs.Empty); }); } else { Processing.Invoke(e); pontos += e.Data.Length; } }
protected virtual void OnScanned(DataEventArgs e) { if (Scanned != null) Scanned(this, e); }