private async void ButtonSourceControlRunbook_Click(object sender, RoutedEventArgs e) { try { JobCreateResponse sourceControlJob = await AutomationSourceControl.startSouceControlJob(iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name); JobOutputWindow jobWindow = new JobOutputWindow(sourceControlJob.Job.Properties.Runbook.Name, sourceControlJob, iseClient); jobWindow.Show(); } catch (Exception ex) { MessageBox.Show("The source control job could not be started. " + ex.Message, "Error"); return; } }
private void ButtonTestRunbook_Click(object sender, RoutedEventArgs e) { AutomationRunbook selectedRunbook = (AutomationRunbook)RunbooksListView.SelectedItem; if (selectedRunbook == null) { MessageBox.Show("No runbook selected."); return; } try { JobOutputWindow jobWindow = new JobOutputWindow(selectedRunbook.Name, iseClient); jobWindow.Show(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error"); } }
private async void ButtonTestRunbook_Click(object sender, RoutedEventArgs e) { try { if (RunbooksListView.SelectedItems.Count > 1) { string message = "Batch creation of test jobs is suppressed for performance reasons."; message += "\r\nPlease create test jobs one at a time, eager beaver!"; MessageBox.Show(message, "Test Job Warning", MessageBoxButton.OK, MessageBoxImage.Warning); return; } ButtonTestRunbook.IsEnabled = false; AutomationRunbook selectedRunbook = (AutomationRunbook)RunbooksListView.SelectedItem; if (selectedRunbook.AuthoringState == AutomationRunbook.AuthoringStates.Published) { beginBackgroundWork(); await AutomationRunbookManager.CheckOutRunbook(selectedRunbook, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount); } JobOutputWindow jobWindow = new JobOutputWindow(selectedRunbook.Name, iseClient); jobWindow.Show(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } finally { SetButtonStatesForSelectedRunbook(); endBackgroundWork(); } }
private void ButtonTestRunbook_Click(object sender, RoutedEventArgs e) { try { if (RunbooksListView.SelectedItems.Count > 1) { string message = "Batch creation of test jobs is suppressed for performance reasons."; message += "\r\nPlease create test jobs one at a time, eager beaver!"; MessageBox.Show(message, "Test Job Warning", MessageBoxButton.OK, MessageBoxImage.Warning); return; } AutomationRunbook selectedRunbook = (AutomationRunbook)RunbooksListView.SelectedItem; JobOutputWindow jobWindow = new JobOutputWindow(selectedRunbook.Name, iseClient); jobWindow.Show(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }