xenadmin/XenAdmin/Commands/CallHomeCommand.cs
Mihaela Stoica 8ce3dc9952 CP-12154: Offer Call Home enrollment when connecting to Call-Home capable hosts
- Check call home enrollment status on connecting to a pool: If status is unknown it means that the pool is not enrolled (enabled) and has never been (disabled). If that's the case, then show the Health Check Overview dialog with the pool selected
- "Enroll now" on Health Check Overview will try enroll the selected pool into call home using existing token authentication. If this is not possible, then a dialog will be presented for the user to perform the initial authentication.
2015-06-08 16:46:16 +01:00

34 lines
1.1 KiB
C#

using System.Linq;
using XenAdmin.Dialogs;
using XenAdmin.Dialogs.CallHome;
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);
}
}
}