资 源 简 介
Purpose
Make backgrounding tasks under Windows.Forms simple and easy.
Example
Usage example:
```
using Backgrounder;
public class Form1 : Form {
protected ProgressBar progressBar1;
protected Button button1;
private BackgroundHelper helper = new BackgroundHelper();
private void button1_Click(object sender, EventArgs e) {
// Execute code in the background.
helper.Background(() => {
for (int i = 0; i <= 100; i++) {
// Continually report progress to user.
helper.Foreground(i, j => {
progressBar1.Value = j;
});
// Simulate doing I/O or whatever.
Thread.Sleep(25);
}
});
}
}
```
Example details
When a button is clicked, the progress bar will slowly tick up. Meanwhile, the GUI will continue to respond normally - Thread.Sleep() is only done on the backgrou