protected override void ExecuteCore(SelectedItemCollection selection) { if (Helpers.FeatureForbidden(selection[0].XenObject, Host.RestrictWLB)) { // Show upsell dialog UpsellDialog dlg = new UpsellDialog(Messages.UPSELL_BLURB_WLB, InvisibleMessages.UPSELL_LEARNMOREURL_WLB); dlg.ShowDialog(Parent); return; } try { Dialogs.Wlb.DisableWLBDialog disableDialog = new XenAdmin.Dialogs.Wlb.DisableWLBDialog(string.Empty); DialogResult dr = disableDialog.ShowDialog(MainWindow.ActiveForm); if (dr == DialogResult.OK) { Actions.Wlb.DisableWLBAction action = new Actions.Wlb.DisableWLBAction(selection[0].PoolAncestor, true); action.Completed += Program.MainWindow.action_Completed; action.RunAsync(); Program.MainWindow.UpdateToolbars(); } } catch (Failure exn) { log.Error(exn, exn); } }
protected override void ExecuteCore(SelectedItemCollection selection) { if (Helpers.FeatureForbidden(selection[0].XenObject, Host.RestrictWLB)) { // Show upsell dialog using (var dlg = new UpsellDialog(HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_WLB : Messages.UPSELL_BLURB_WLB + Messages.UPSELL_BLURB_WLB_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_WLB)) dlg.ShowDialog(Parent); return; } try { Dialogs.Wlb.DisableWLBDialog disableDialog = new XenAdmin.Dialogs.Wlb.DisableWLBDialog(string.Empty); DialogResult dr = disableDialog.ShowDialog(MainWindow.ActiveForm); if (dr == DialogResult.OK) { Actions.Wlb.DisableWLBAction action = new Actions.Wlb.DisableWLBAction(selection[0].PoolAncestor, true); action.Completed += Program.MainWindow.action_Completed; action.RunAsync(); Program.MainWindow.UpdateToolbars(); } } catch (Failure exn) { log.Error(exn, exn); } }