CanExecute() protected method

protected CanExecute ( XenAPI.VM vm ) : bool
vm XenAPI.VM
return bool
Esempio n. 1
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            VM vm = (VM)selection[0].XenObject;

            if (CrossPoolCopyVMCommand.CanExecute(vm, null, false))
            {
                new CrossPoolCopyVMCommand(MainWindowCommandInterface, selection).Execute();
            }
            else
            {
                MainWindowCommandInterface.ShowPerXenModelObjectWizard(vm, new CopyVMDialog(vm));
            }
        }
Esempio n. 2
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            VM vm = (VM)selection[0].XenObject;

            if (CrossPoolCopyVMCommand.CanExecute(vm, null))
            {
                new CrossPoolCopyVMCommand(MainWindowCommandInterface, selection).Execute();
            }
            else
            {
                new CopyVMDialog(vm).ShowPerXenObject(vm, Program.MainWindow);
            }
        }
Esempio n. 3
0
 private static bool CanExecute(VM vm)
 {
     return(vm != null && (CrossPoolCopyVMCommand.CanExecute(vm, null, false) || vm.CanBeCopied()));
 }