private async void btnSystemStop_Click(object sender, EventArgs e) { try { var confirmResult = MessageBox.Show( string.Format("Are you sure to stop all instances in: '{0}'? If you click the system will be unavailable!", GlobalVariables.Enviroment.ToString()), "Confirm Shut Down System", MessageBoxButtons.YesNo); if (confirmResult == DialogResult.Yes) { imgAppStatus.Image = Properties.Resources.Button_Blank_Red_icon; imgRdsStatus.Image = Properties.Resources.Button_Blank_Red_icon; imgScheduleStatus.Image = Properties.Resources.Button_Blank_Red_icon; var manager = new SystemManagement(); await manager.ShutDownSystem(cboxStopJumpbox.Checked); WriteNotification(String.Format("{0} system is stopped!", GlobalVariables.Enviroment.ToString())); } } catch (Exception ex) { HandleException(ex); } finally { await PopulateSystemStatus(); } }