protected virtual void onUpdateProgress() { lock (_lock) { _currentProgress++; var handler = UpdateProgress; if (handler != null) { double progress = (double)_currentProgress / _totalProgress; handler(this, new ProgressEventArgs(progress)); } } }