Rev | Line | |
---|
[5525] | 1 | using System;
|
---|
| 2 | using System.Threading.Tasks;
|
---|
| 3 | using System.Windows.Forms;
|
---|
| 4 |
|
---|
| 5 | namespace HeuristicLab.Clients.Hive.Views.Common {
|
---|
| 6 | public partial class UpdateControl : UserControl {
|
---|
| 7 | public UpdateControl() {
|
---|
| 8 | InitializeComponent();
|
---|
| 9 | }
|
---|
| 10 |
|
---|
| 11 | public Action UpdateAction { get; set; }
|
---|
| 12 |
|
---|
| 13 | private void PrivUpdateAction() {
|
---|
| 14 | UpdateAction();
|
---|
| 15 | imgBoxProgress.Invoke(new MethodInvoker(() => imgBoxProgress.Visible = false));
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | private void btnRefresh_Click(object sender, EventArgs e) {
|
---|
| 19 | if (UpdateAction != null) {
|
---|
| 20 | imgBoxProgress.Visible = true;
|
---|
| 21 | Action action = new Action(PrivUpdateAction);
|
---|
| 22 | Task task = new Task(action);
|
---|
| 23 | task.Start();
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.