mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-29 02:18:07 +01:00
CA-293092: Enhanced the logic of the SuccessfulDescription in the defining
class so the caller won't have to worry about it. Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
7ea811e942
commit
741bfaa864
@ -49,11 +49,16 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
return list;
|
||||
}
|
||||
|
||||
public abstract string Description{ get;}
|
||||
public abstract string Description { get; }
|
||||
|
||||
public virtual string SuccessfulCheckDescription
|
||||
public virtual string SuccessfulCheckDescription
|
||||
{
|
||||
get { return string.Empty; }
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(Description)
|
||||
? string.Empty
|
||||
: string.Format(Messages.PATCHING_WIZARD_CHECK_OK, Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,5 +48,15 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
{
|
||||
get { return _host; }
|
||||
}
|
||||
|
||||
public override string SuccessfulCheckDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(Description)
|
||||
? string.Empty
|
||||
: string.Format(Messages.PATCHING_WIZARD_HOST_CHECK_OK, Host.Name(), Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
using XenAdmin.Core;
|
||||
using XenAPI;
|
||||
|
||||
|
||||
namespace XenAdmin.Diagnostics.Checks
|
||||
{
|
||||
public abstract class PoolCheck : Check
|
||||
@ -46,5 +47,15 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
{
|
||||
get { return _pool; }
|
||||
}
|
||||
|
||||
public override string SuccessfulCheckDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(Description)
|
||||
? string.Empty
|
||||
: string.Format(Messages.PATCHING_WIZARD_HOST_CHECK_OK, Helpers.GetPoolOfOne(_pool.Connection), Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -723,23 +723,14 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
? Images.GetImage16For(Icons.Ok)
|
||||
: Problem.Image;
|
||||
|
||||
string description = string.Empty;
|
||||
string description = null;
|
||||
|
||||
if (Problem != null)
|
||||
description = Problem.Description;
|
||||
else if (_check != null)
|
||||
{
|
||||
description = _check.SuccessfulCheckDescription;
|
||||
if (string.IsNullOrEmpty(description))
|
||||
{
|
||||
var hostCheck = _check as HostCheck;
|
||||
description = hostCheck != null
|
||||
? String.Format(Messages.PATCHING_WIZARD_HOST_CHECK_OK, hostCheck.Host.Name(), _check.Description)
|
||||
: String.Format(Messages.PATCHING_WIZARD_CHECK_OK, _check.Description);
|
||||
}
|
||||
}
|
||||
|
||||
if (description != string.Empty)
|
||||
if (!string.IsNullOrEmpty(description))
|
||||
_descriptionCell.Value = String.Format(Messages.PATCHING_WIZARD_DESC_CELL_INDENT, null, description);
|
||||
|
||||
_solutionCell.Value = Problem == null ? string.Empty : Problem.HelpMessage;
|
||||
|
Loading…
Reference in New Issue
Block a user