protected virtual void OnDrawComplete(ProgressDataEventArgs e) { EventHandler handler = DrawCompleted; if (handler != null) { handler(this, e); } }
void _backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (_progressBar.Value == _progressBar.Maximum) { setMapTable(); _backgroundWorker.DoWork -= _backgroundWorker_DoWork; _viewPanel.ControlAdded -= _viewPanel_ControlAdded; var args = new ProgressDataEventArgs() { CompletedElements = _progressBar.Value, TotalElement = _progressBar.Maximum }; OnDrawComplete(args); } }
void _backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (_progressBar.Value == _progressBar.Maximum) { _backgroundWorker.DoWork -= _backgroundWorker_DoWork; var args = new ProgressDataEventArgs() { CompletedElements = _progressBar.Value, TotalElement = _progressBar.Maximum }; OnDrawComplete(args); } }