Ejemplo n.º 1
0
        protected override bool CanExecuteCore(SelectedItemCollection selection)
        {
            if (typeof(T) == typeof(VMSS) && selection.Any(s => !Helpers.FalconOrGreater(s.Connection)))
            {
                return(false);
            }

            return(selection.FirstAsXenObject != null && selection.FirstAsXenObject.Connection != null && selection.FirstAsXenObject.Connection.IsConnected &&
                   VMGroup <T> .FeaturePossible(selection.FirstAsXenObject.Connection) &&
                   (selection.PoolAncestor != null || selection.HostAncestor != null));                //CA-61207: this check ensures there's no cross-pool selection
        }
Ejemplo n.º 2
0
 public bool CanExecute(VM vm)
 {
     return(vm != null && vm.is_a_real_vm && !vm.Locked && VMGroup <T> .FeaturePossible(vm.Connection) &&
            !Helpers.FeatureForbidden(vm.Connection, VMGroup <T> .FeatureRestricted));
 }