示例#1
0
        private async void deploySitesButton_Click(object sender, EventArgs e)
        {
            string waitMessage = "Please Wait...";

            if (deploySitesButton.Text == waitMessage)
            {
                return;
            }

            string originalButtonText = deploySitesButton.Text;

            deploySitesButton.Text    = waitMessage;
            progress.ProgressChanged += ReportProgress;

            try
            {
                await deploy.DeploySoftwareAsync(selectedSites.ToList(), progress);

                dashboardStatus.Text = "Process Complete";
            }
            catch (Exception ex)
            {
                dashboardStatus.Text = ex.Message;
            }
            finally
            {
                dashboardProgress.Value   = 0;
                dashboardProgress.Visible = false;
                deploySitesButton.Text    = originalButtonText;
            }
        }