Renamed method SolveImmediately to GetSolutionAction because the old name was misleading: the method creates the action, it doesn't run it.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-06-29 14:48:49 +01:00 committed by Mihaela Stoica
parent dc8b2379c2
commit 7ea811e942
3 changed files with 9 additions and 11 deletions

View File

@ -80,7 +80,7 @@ namespace XenAdmin.Diagnostics.Problems
return null;
}
public AsyncAction SolveImmediately(out bool cancelled)
public AsyncAction GetSolutionAction(out bool cancelled)
{
DeregisterSolutionActionEvent();
solutionAction = CreateAction(out cancelled);

View File

@ -43,7 +43,6 @@ using XenAdmin.Diagnostics.Checks;
using XenAdmin.Diagnostics.Checks.DR;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Dialogs;
using XenAdmin.Properties;
using XenAPI;
using XenAdmin.Actions.DR;
@ -476,17 +475,16 @@ namespace XenAdmin.Wizards.DRWizards
return warnings;
}
private ActionProgressDialog _progressDialog = null;
private void ExecuteSolution(PreCheckItemRow preCheckRow)
{
bool cancelled;
AsyncAction action = preCheckRow.Problem.SolveImmediately(out cancelled);
AsyncAction action = preCheckRow.Problem.GetSolutionAction(out cancelled);
if (action != null)
{
action.Completed += action_Completed;
_progressDialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks);
_progressDialog.ShowDialog(this);
using (var progressDialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks))
progressDialog.ShowDialog(this);
if (action.Succeeded)
{
var revertAction = preCheckRow.Problem.UnwindChanges();
@ -531,7 +529,7 @@ namespace XenAdmin.Wizards.DRWizards
if (preCheckRow != null && preCheckRow.Problem != null)
{
bool cancelled;
AsyncAction action = preCheckRow.Problem.SolveImmediately(out cancelled);
AsyncAction action = preCheckRow.Problem.GetSolutionAction(out cancelled);
if (action != null)
{
actions.Add(action, preCheckRow.Problem.UnwindChanges());
@ -540,8 +538,8 @@ namespace XenAdmin.Wizards.DRWizards
}
foreach (var asyncAction in actions.Keys)
{
_progressDialog = new ActionProgressDialog(asyncAction, ProgressBarStyle.Blocks);
_progressDialog.ShowDialog(this);
using (var progressDialog = new ActionProgressDialog(asyncAction, ProgressBarStyle.Blocks))
progressDialog.ShowDialog(this);
if (asyncAction.Succeeded && actions[asyncAction] != null)
RevertActions.Add(actions[asyncAction]);

View File

@ -851,7 +851,7 @@ namespace XenAdmin.Wizards.PatchingWizard
private void ExecuteSolution(PreCheckHostRow preCheckHostRow)
{
bool cancelled;
resolvePrechecksAction = preCheckHostRow.Problem.SolveImmediately(out cancelled);
resolvePrechecksAction = preCheckHostRow.Problem.GetSolutionAction(out cancelled);
if (resolvePrechecksAction != null)
{
@ -897,7 +897,7 @@ namespace XenAdmin.Wizards.PatchingWizard
if (preCheckHostRow != null && preCheckHostRow.Problem != null)
{
bool cancelled;
AsyncAction action = preCheckHostRow.Problem.SolveImmediately(out cancelled);
AsyncAction action = preCheckHostRow.Problem.GetSolutionAction(out cancelled);
if (action != null)
{
preCheckHostRow.Enabled = false;