private void buttonViewFolderInExplorer_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBoxFolder.Text) == false) { ExecuteAndForget.Execute(textBoxFolder.Text); } }
private async void buttonGenerateReport_Click(object sender, EventArgs e) { SetStatus("Running, please wait..."); //Disable UI/button to prevent the user to start it again buttonGenerateReport.Enabled = false; this.UseWaitCursor = true; Application.DoEvents(); //Create an progress object so we can get updates. //This will capture the current SyncContext so we can assign an event handler directly without any special handling Progress <RunnerProgressDetail> progressRunner = new Progress <RunnerProgressDetail>(); progressRunner.ProgressChanged += RunnerProgressUpdate; //Do this also for the report creation Progress <ReportCreationProgress> progressReport = new Progress <ReportCreationProgress>(); progressReport.ProgressChanged += ReportProgressUpdate; SimplifiedXteq5Runner simpleRunner = new SimplifiedXteq5Runner(textBoxFolder.Text, textBoxUserText.Text, _outputFormat); bool result = await simpleRunner.RunAsync(progressRunner, progressReport); //Enable UI again this.UseWaitCursor = false; buttonGenerateReport.Enabled = true; Application.DoEvents(); if (result == true) { //All good. Show the report. ExecuteAndForget.Execute(simpleRunner.ReportFilepath); SetStatus("Done. The report will be displayed in a second."); } else { //An error during execution was detected SetStatus("Failed"); //Error message from Firefox: Well, this is embarrassing //Error message from Apache server: We're sorry, but something went wrong string title = "We're sorry, but something went wrong"; string message = string.Format("{0}\r\n\r\n\r\nDo you wish to view technical details?", simpleRunner.FailedMessage); if (MessageBox.Show(message, title, MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes) { MonospacedTextForm mtform = new MonospacedTextForm(); mtform.Title = "Details"; mtform.Content = simpleRunner.FailedException.ToString(); mtform.ShowDialog(); } } }
private void richTextBox_LinkClicked(object sender, LinkClickedEventArgs e) { ExecuteAndForget.Execute(e.LinkText); }
private void menuCmdHelpHomepage_Click(object sender, EventArgs e) { ExecuteAndForget.Execute(Xteq5UIConstant.HomepageURL); }
private void menuHelpHowtoUse_Click(object sender, EventArgs e) { ExecuteAndForget.Execute(Xteq5UIConstant.HowtoUseURL); }
private void menuCmdHelpDocumentation_Click(object sender, EventArgs e) { ExecuteAndForget.Execute(Xteq5UIConstant.DocumentationURL); }