private void ResetPathTestStatus() { if (pathTestStatus != PathTestStatus.NotStarted) { m_labelError.Visible = false; pictureBoxTest.Visible = false; pathTestStatus = PathTestStatus.NotStarted; } }
private void TestPath() { textBoxPath.Enabled = false; m_labelError.Visible = false; pictureBoxTest.Image = Properties.Resources.ajax_loader; pictureBoxTest.Visible = true; var archiveConfig = ArchiveConfig; //todo: get string for archive destination archiveConfig.Add("type", vmpp_archive_target_type_helper.ToString(ArchiveTargetType)); var action = new TestArchiveTargetAction(Pool.Connection, archiveConfig); action.Completed += action_Completed; // mark test as in progress; this will disable the Next button (or OK button for Properties dialog) until the test is complete pathTestStatus = PathTestStatus.InProgress; OnPageUpdated(); EnableOkButton(); action.RunAsync(); }
private void action_Completed(ActionBase sender) { AsyncAction action = (AsyncAction)sender; Program.Invoke(this, () => { if (action.Result != "True" || action.Result == null) { m_labelError.Visible = true; pathTestStatus = PathTestStatus.Error; pictureBoxTest.Image = Properties.Resources._000_Abort_h32bit_16; } else { pathTestStatus = PathTestStatus.Success; pictureBoxTest.Image = Properties.Resources._000_Tick_h32bit_16; } textBoxPath.Enabled = true; OnPageUpdated(); EnableOkButton(); }); }
private void action_Completed(object sender, EventArgs e) { AsyncAction action = (AsyncAction)sender; Program.Invoke(this, () => { if (action.Result != "True" || action.Result == null) { m_labelError.Visible = true; pathTestStatus = PathTestStatus.Error; pictureBoxTest.Image = Properties.Resources._000_Abort_h32bit_16; } else { pathTestStatus = PathTestStatus.Success; pictureBoxTest.Image = Properties.Resources._000_Tick_h32bit_16; } textBoxPath.Enabled = true; OnPageUpdated(); EnableOkButton(); }); }