private void incrementProgress(int count = 1) { if (progressBar.InvokeRequired) { var increment = new IncrementDelegator(progressBar.Increment); progressBar.Invoke(increment, count); } else { progressBar.Increment(count); } }
private void incrementProgressBarMax(int count) { if (progressBar.InvokeRequired) { var increment = new IncrementDelegator(incrementProgressBarMax); progressBar.Invoke(increment, count); } else { actualProgressBarSum += count; progressBar.Maximum = Math.Max(progressBar.Maximum, actualProgressBarSum); } }