protected virtual void RaiseNewItem(NewItemEventArgs args) { if (NewItem != null) NewItem(this, args); }
void _scraper_NewItem(object sender, NewItemEventArgs e) { if (!_started) { //labelStatus.BeginInvoke((Action)(() => //{ // labelStatus.Text = "Cancelled"; //})); return; }; try { _totalItems++; dataGridViewItems.BeginInvoke((Action) (() => { AddGridItem(e.Item); })); labelTotal.BeginInvoke((Action)(() => { labelTotal.Text = string.Format("Total: {0}", _totalItems); })); } catch { } }