Пример #1
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            VM vm = (VM)selection[0].XenObject;

            if (CrossPoolMoveVMCommand.CanExecute(vm, null))
            {
                new CrossPoolMoveVMCommand(MainWindowCommandInterface, selection).Execute();
            }
            else
            {
                MainWindowCommandInterface.ShowPerXenModelObjectWizard(vm, new MoveVMDialog(vm));
            }
        }
Пример #2
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            var cmd = new CrossPoolMoveVMCommand(MainWindowCommandInterface, selection);
            var con = selection.GetConnectionOfFirstItem();

            if (cmd.CanExecute() && !Helpers.FeatureForbidden(con, Host.RestrictCrossPoolMigrate))
            {
                cmd.Execute();
            }
            else
            {
                VM vm = (VM)selection[0].XenObject;
                MainWindowCommandInterface.ShowPerXenModelObjectWizard(vm, new MoveVMDialog(vm));
            }
        }
Пример #3
0
 private static bool CanExecute(VM vm)
 {
     return(vm != null && (CrossPoolMoveVMCommand.CanExecute(vm, null) || vm.CanBeMoved()));
 }