protected override bool CanExecuteCore(SelectedItemCollection selection) { // Can execute criteria: A selection of VMs in the same pool which has CBT feature licensed, where at least one VM having CBT enabled return(selection.AllItemsAre <VM>(CbtLicensed) && selection.GetConnectionOfAllItems() != null && selection.AtLeastOneXenObjectCan <VM>(CanExecute)); }
protected override bool CanExecuteCore(SelectedItemCollection selection) { var connection = selection.GetConnectionOfAllItems(); var pool = Helpers.GetPool(connection); if (pool == null) { return(false); } return(connection.Cache.Hosts.Any(RemoveHostFromPoolCommand.CanExecute)); }
protected override bool CanExecuteCore(SelectedItemCollection selection) { // Can execute criteria: A selection of VMs in the same pool, where at least one doesn't have PVS read caching enabled if (selection.Any() && selection.AllItemsAre <VM>() && selection.GetConnectionOfAllItems() != null) { var vms = selection.AsXenObjects <VM>(); if (vms.Any(vm => vm.PvsProxy != null)) { return(true); } } return(false); }
protected override bool CanExecuteCore(SelectedItemCollection selection) { if (selection.Any(i => !(i.XenObject is Host) && !(i.XenObject is Pool))) { return(false); } var conn = selection.GetConnectionOfAllItems(); if (conn == null || !Helpers.StockholmOrGreater(conn) || conn.Cache.Hosts.Any(Host.RestrictPoolSecretRotation)) { return(false); } var pool = Helpers.GetPoolOfOne(conn); return(pool != null && !pool.ha_enabled && !pool.RollingUpgrade()); }
protected override bool CanExecuteCore(SelectedItemCollection selection) { // Must have a selection, of all VMs if (selection.Any() && selection.AllItemsAre <VM>()) { // Must all be in the same pool, which must have at least one PVS site var connection = selection.GetConnectionOfAllItems(); if (connection == null || !connection.Cache.PVS_sites.Any()) { return(false); } // At least one must not currently have a PVS Proxy var vms = selection.AsXenObjects <VM>(); if (vms.Any(vm => vm.PvsProxy() == null)) { return(true); } } return(false); }
protected override bool CanExecuteCore(SelectedItemCollection selection) { return(selection.Count > 0 && selection.AllItemsAre <VM>() && selection.GetConnectionOfAllItems() != null && selection.Any(CanExecute)); }