1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Server/ProgressForm.cs Sat Jan 17 18:26:41 2015 +0100
1.3 @@ -0,0 +1,55 @@
1.4 +using System;
1.5 +using System.Collections.Generic;
1.6 +using System.ComponentModel;
1.7 +using System.Data;
1.8 +using System.Drawing;
1.9 +using System.Linq;
1.10 +using System.Text;
1.11 +using System.Windows.Forms;
1.12 +
1.13 +namespace BackgroundWorkerDemo
1.14 +{
1.15 + public partial class ProgressForm : Form
1.16 + {
1.17 +
1.18 + #region PROPERTIES
1.19 +
1.20 + public string Message
1.21 + {
1.22 + set { labelMessage.Text = value; }
1.23 + }
1.24 +
1.25 + public int ProgressValue
1.26 + {
1.27 + set { progressBar1.Value = value; }
1.28 + }
1.29 +
1.30 + #endregion
1.31 +
1.32 + #region METHODS
1.33 +
1.34 + public ProgressForm()
1.35 + {
1.36 + InitializeComponent();
1.37 + }
1.38 +
1.39 + #endregion
1.40 +
1.41 + #region EVENTS
1.42 +
1.43 + public event EventHandler<EventArgs> Canceled;
1.44 +
1.45 + private void buttonCancel_Click(object sender, EventArgs e)
1.46 + {
1.47 + // Create a copy of the event to work with
1.48 + EventHandler<EventArgs> ea = Canceled;
1.49 + /* If there are no subscribers, eh will be null so we need to check
1.50 + * to avoid a NullReferenceException. */
1.51 + if (ea != null)
1.52 + ea(this, e);
1.53 + }
1.54 +
1.55 + #endregion
1.56 +
1.57 + }
1.58 +}