internal void EditWLB(Pool pool) { // Do nothing if there is a WLB action in progress if (HelpersGUI.FindActiveWLBAction(pool.Connection) != null) { log.Debug("Not opening WLB dialog: an WLB action is in progress"); return; } if (!pool.Connection.IsConnected) { log.Debug("Not opening WLB dialog: the connection to the pool is now closed"); return; } try { WlbConfigurationDialog wlbConfigDialog = new WlbConfigurationDialog(pool); DialogResult dr = wlbConfigDialog.ShowDialog(); if (dr == DialogResult.OK) { _wlbPoolConfiguration = wlbConfigDialog.WlbPoolConfiguration; //check to see if the current opt mode matches the current schedule if (_wlbPoolConfiguration.AutomateOptimizationMode) { WlbPoolPerformanceMode scheduledPerfMode = _wlbPoolConfiguration.ScheduledTasks.GetCurrentScheduledPerformanceMode(); if (scheduledPerfMode != _wlbPoolConfiguration.PerformanceMode) { string blurb = string.Format(Messages.WLB_PROMPT_FOR_MODE_CHANGE_BLURB, getOptModeText(scheduledPerfMode), getOptModeText(_wlbPoolConfiguration.PerformanceMode)); DialogResult drModeCheck; using (var dlg = new ThreeButtonDialog( new ThreeButtonDialog.Details(null, blurb, Messages.WLB_PROMPT_FOR_MODE_CHANGE_CAPTION), ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo)) { drModeCheck = dlg.ShowDialog(this); } if (drModeCheck == DialogResult.Yes) { _wlbPoolConfiguration.PerformanceMode = scheduledPerfMode; } } } SaveWLBConfig(_wlbPoolConfiguration); } } catch (Exception ex) { log.Debug("Unable to open the WLB configuration dialog.", ex); return; } if (!(WlbServerState.GetState(_pool) == WlbServerState.ServerState.NotConfigured)) { RetrieveConfiguration(); } }
private static WlbPoolPerformanceMode GetTaskOptMode(WlbScheduledTask task) { WlbPoolPerformanceMode mode = WlbPoolPerformanceMode.MaximizePerformance; if (task.TaskParameters["OptMode"] == "0") { mode = WlbPoolPerformanceMode.MaximizePerformance; } else { mode = WlbPoolPerformanceMode.MaximizeDensity; } return(mode); }
private string getOptModeText(WlbPoolPerformanceMode mode) { return((mode == WlbPoolPerformanceMode.MaximizePerformance) ? Messages.WLB_OPT_MODE_MAXIMIZEPERFORMANCE : Messages.WLB_OPT_MODE_MAXIMIZEDENSITY); }
private string getOptModeText(WlbPoolPerformanceMode mode) { return (mode == WlbPoolPerformanceMode.MaximizePerformance) ? Messages.WLB_OPT_MODE_MAXIMIZEPERFORMANCE : Messages.WLB_OPT_MODE_MAXIMIZEDENSITY; }