Exemplo n.º 1
0
        public override void PageLeave(XenAdmin.Controls.PageLoadedDirection direction, ref bool cancel)
        {
            if (!cancel)
            {
                bool targetDisconnected = cancel;
                Program.Invoke(Program.MainWindow,
                               delegate
                {
                    if (Connection == null || !Connection.IsConnected)
                    {
                        CrossPoolMigrateWizard.ShowWarningMessageBox(Messages.CPM_WIZARD_ERROR_TARGET_DISCONNECTED);
                        targetDisconnected = true;
                    }
                });
                cancel = targetDisconnected;
            }

            if (!cancel && !CrossPoolMigrateWizard.AllVMsAvailable(selectedVMs))
            {
                cancel = true;
                SetButtonNextEnabled(false);
            }

            base.PageLeave(direction, ref cancel);
        }
 protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel)
 {
     if (!CrossPoolMigrateWizard.AllVMsAvailable(selectedVMs))
     {
         cancel = true;
         SetButtonsEnabled(false);
     }
 }
Exemplo n.º 3
0
 protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel)
 {
     if (!CrossPoolMigrateWizard.AllVMsAvailable(VmMappings, Connection))
     {
         cancel = true;
         SetButtonNextEnabled(false);
         SetButtonPreviousEnabled(false);
     }
 }
Exemplo n.º 4
0
        protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel)
        {
            var l = new List <VM>();

            l.Add(TheVM);
            if (!CrossPoolMigrateWizard.AllVMsAvailable(l))
            {
                cancel = true;
                SetButtonsEnabled(false);
            }
        }
Exemplo n.º 5
0
        protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel)
        {
            if (direction != PageLoadedDirection.Forward)
            {
                return;
            }

            var l = new List <VM> {
                TheVM
            };

            if (!CrossPoolMigrateWizard.AllVMsAvailable(l))
            {
                cancel = true;
            }
        }
Exemplo n.º 6
0
        protected override bool PerformCheck()
        {
            if (ChosenItem != null && (ChosenItem.Connection == null || !ChosenItem.Connection.IsConnected))
            {
                CrossPoolMigrateWizard.ShowWarningMessageBox(Messages.CPM_WIZARD_ERROR_TARGET_DISCONNECTED);
                return(false);
            }

            if (selectedVMs == null || selectedVMs.Count == 0 || Connection == null ||
                selectedVMs.Any(vm => Connection.Resolve(new XenRef <VM>(vm)) == null))
            {
                CrossPoolMigrateWizard.ShowWarningMessageBox(Messages.CPM_WIZARD_VM_MISSING_ERROR);
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            var con = selection.GetConnectionOfFirstItem();

            if (Helpers.FeatureForbidden(con, Host.RestrictCrossPoolMigrate))
            {
                ShowUpsellDialog(Parent);
            }
            else
            {
                var wizard = new CrossPoolMigrateWizard(con, selection, preSelectedHost, WizardMode.Migrate, _resumeAfter);
                MainWindowCommandInterface.ShowPerConnectionWizard(con, wizard);
            }
        }