xenadmin/XenAdmin/Commands/CallHomeCommand.cs
Mihaela Stoica a9be9846ff CP-13073: Rename Call Home to Health Check in code
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2015-07-29 08:44:41 +01:00

35 lines
1.1 KiB
C#

using System.Linq;
using XenAdmin.Core;
using XenAPI;
namespace XenAdmin.Commands
{
internal class HealthCheckCommand : Command
{
/// <summary>
/// Initializes a new instance of this Command. The parameter-less constructor is required if
/// this Command is to be attached to a ToolStrip menu item or button. It should not be used in any other scenario.
/// </summary>
public HealthCheckCommand()
{
}
public HealthCheckCommand(IMainWindow mainWindow)
: base(mainWindow)
{
}
protected override void ExecuteCore(SelectedItemCollection selection)
{
if (Program.MainWindow.HealthCheckOverviewLauncher != null)
Program.MainWindow.HealthCheckOverviewLauncher.LaunchIfRequired(false, selection);
}
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
return ConnectionsManager.XenConnectionsCopy.Any(xenConnection => xenConnection.IsConnected
&& !Helpers.FeatureForbidden(xenConnection, Host.RestrictHealthCheck));
}
}
}