mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-30 07:40:13 +01:00
926d69d132
- also the "Health Check" menu item will only be enabled if the feature is available Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System.Linq;
|
|
using XenAdmin.Core;
|
|
using XenAPI;
|
|
|
|
namespace XenAdmin.Commands
|
|
{
|
|
internal class CallHomeCommand : 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 CallHomeCommand()
|
|
{
|
|
}
|
|
|
|
public CallHomeCommand(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));
|
|
}
|
|
}
|
|
}
|