Server/ProgressForm.cs
author StephaneLenclud
Sat, 07 Feb 2015 14:39:03 +0100
changeset 110 31e63bd07dfa
permissions -rw-r--r--
Cleaning up design tab by removing layout debug buttons.
Separator changes now reflected instantly.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Windows.Forms;
     9 
    10 namespace BackgroundWorkerDemo
    11 {
    12     public partial class ProgressForm : Form
    13     {
    14 
    15         #region PROPERTIES
    16 
    17         public string Message
    18         {
    19             set { labelMessage.Text = value; }
    20         }
    21 
    22         public int ProgressValue
    23         {
    24             set { progressBar1.Value = value; }
    25         }
    26 
    27         #endregion
    28 
    29         #region METHODS
    30 
    31         public ProgressForm()
    32         {
    33             InitializeComponent();
    34         }
    35 
    36         #endregion
    37 
    38         #region EVENTS
    39 
    40         public event EventHandler<EventArgs> Canceled;
    41 
    42         private void buttonCancel_Click(object sender, EventArgs e)
    43         {
    44             // Create a copy of the event to work with
    45             EventHandler<EventArgs> ea = Canceled;
    46             /* If there are no subscribers, eh will be null so we need to check
    47              * to avoid a NullReferenceException. */
    48             if (ea != null)
    49                 ea(this, e);
    50         }
    51 
    52         #endregion
    53 
    54     }
    55 }