Removed commented out and dead code.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2021-05-26 18:35:56 +01:00
parent 3082745c85
commit 393e041c4f
6 changed files with 0 additions and 113 deletions

View File

@ -171,7 +171,6 @@ namespace XenAdmin.Controls.Wlb
weekView1.ClearTriggerPoints();
lvTaskList.Items.Clear();
//foreach (int key in _scheduledTasks.SortedTaskList.Keys)
foreach (int key in _scheduledTasks.VirtualTaskList.Keys)
{
//WlbScheduledTask task = _scheduledTasks.SortedTaskList[key];
@ -190,10 +189,7 @@ namespace XenAdmin.Controls.Wlb
item.SubItems.Add(task.Enabled ? Messages.YES : Messages.NO);
item.Tag = task;
lvTaskList.Items.Add(item);
//}
//foreach (WlbScheduledTask task in _scheduledTasks.VirtualTaskList.Values)
//{
if (task.Enabled)
{
//DateTime localExecuteTime;
@ -216,34 +212,6 @@ namespace XenAdmin.Controls.Wlb
EnableButtons();
}
//private void AddTaskToList(WlbScheduledTask task)
//{
// foreach (WlbScheduledTask.WlbTaskDaysOfWeek dayValue in Enum.GetValues(typeof(WlbScheduledTask.WlbTaskDaysOfWeek)))
// {
// if (dayValue != WlbScheduledTask.WlbTaskDaysOfWeek.None &&
// dayValue != WlbScheduledTask.WlbTaskDaysOfWeek.All &&
// dayValue != WlbScheduledTask.WlbTaskDaysOfWeek.Weekdays &&
// dayValue != WlbScheduledTask.WlbTaskDaysOfWeek.Weekends &&
// ((task.DaysOfWeek & dayValue) == dayValue))
// {
// DateTime localExecuteTime;
// WlbScheduledTask.WlbTaskDaysOfWeek localDaysOfWeek;
// WlbScheduledTask.GetLocalTaskTimes((task.DaysOfWeek & dayValue), task.ExecuteTime, out localDaysOfWeek, out localExecuteTime);
// int sortValue = (int)localDaysOfWeek * 10000 + (int)localExecuteTime.TimeOfDay.TotalMinutes;
// ListViewItem item = new ListViewItem();
// item.Text = sortValue.ToString();
// item.SubItems.Add(GetTaskOptMode(task) == WlbPoolPerformanceMode.MaximizeDensity ? Messages.WLB_OPT_MODE_MAXIMIZEDENSITY : Messages.WLB_OPT_MODE_MAXIMIZEPERFORMANCE);
// item.SubItems.Add(GetTaskDayOfWeek(localDaysOfWeek));
// item.SubItems.Add(GetTaskExecuteTime(localExecuteTime));
// item.SubItems.Add(task.Enabled ? Messages.YES : Messages.NO);
// item.Tag = task;
// lvTaskList.Items.Add(item);
// }
// }
//}
private void FixColumnWidths()
{
//Make sure the last column always spans the width of the control
@ -501,7 +469,6 @@ namespace XenAdmin.Controls.Wlb
return HelpersGUI.DateTimeToString(time, Messages.DATEFORMAT_HM, true);
}
#endregion Private Static Methods
#region ListView Custom Rendering Event Handlers
@ -783,17 +750,6 @@ namespace XenAdmin.Controls.Wlb
public int Compare(object x, object y)
{
return CompareDouble(double.Parse(((ListViewItem)x).Text), double.Parse(((ListViewItem)y).Text));
//WlbScheduledTask taskX = (WlbScheduledTask)((ListViewItem)x).Tag;
//WlbScheduledTask taskY = (WlbScheduledTask)((ListViewItem)y).Tag;
//int returnVal = -1;
//returnVal = CompareInt((int)taskX.DaysOfWeek, (int)taskY.DaysOfWeek);
//if (returnVal == 0)
//{
// returnVal = CompareDouble(taskX.ExecuteTime.TimeOfDay.TotalMinutes, taskY.ExecuteTime.TimeOfDay.TotalMinutes);
//}
//return returnVal;
}
private int CompareDouble(double x, double y)
@ -835,11 +791,5 @@ namespace XenAdmin.Controls.Wlb
}
#endregion
//private void lvTaskList_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
//{
// if(e.IsSelected)
// SelectTask(TaskFromItem(e.Item).TaskId);
//}
}
}

View File

@ -85,8 +85,6 @@ namespace XenAdmin.Controls.Wlb
optimizePoolListView.SmallImageList = Images.ImageList16;
optimizePoolListView.ListViewItemSorter = columnSorter;
//linkLabelReportHistory.Visible = false;
recommendationUpdateTimer = new System.Threading.Timer(TimerCallback, null, 0, 0);
StartTimer();
}
@ -161,8 +159,6 @@ namespace XenAdmin.Controls.Wlb
this.SuspendLayout();
if (WlbServerState.GetState(_pool) == WlbServerState.ServerState.Enabled)
{
//linkLabelReportHistory.Visible = true;
// Update listView VM/Host header text
this.optimizePoolListView.BeginUpdate();
this.columnHeader1.Text = Messages.WLB_OPT_HEADER_VMHOST;
@ -170,8 +166,6 @@ namespace XenAdmin.Controls.Wlb
}
else
{
//linkLabelReportHistory.Visible = false;
// Update listView VM/Host header text
this.optimizePoolListView.BeginUpdate();
this.columnHeader1.Text = Messages.WLB_OPT_HEADER_VM;
@ -220,21 +214,8 @@ namespace XenAdmin.Controls.Wlb
}
#endregion
// TODO: remove unused event handler
#region Event Handlers
// draw the gradient line, override OnPaint in System.Drawing.Drawing2D
/*
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
using (Brush brush = new LinearGradientBrush(Point.Empty, new Point(this.Width / 2, 0), XenAdmin.TabPages.BaseTabPage.HeaderBorderColor, BackColor))
{
e.Graphics.FillRectangle(brush, 0, 20, this.Width / 2, 1);
}
}
*/
/// <summary>
/// Triggered when pool wlb enabled/disabled and optimize pool
/// </summary>
@ -469,11 +450,6 @@ namespace XenAdmin.Controls.Wlb
WlbOptimizationRecommendation optVMmSetting = (WlbOptimizationRecommendation)row.Tag;
// update icon and vm/host name
//row.ImageIndex = (int)Images.GetIconFor(optVMmSetting.vm);
//row.SubItems[0].Text = optVMmSetting.vm.name_label;
//row.SubItems[1].Text = optVMmSetting.fromHost.name_label;
//row.SubItems[2].Text = optVMmSetting.toHost.name_label;
if (String.IsNullOrEmpty(optVMmSetting.toHost.name_label) || String.IsNullOrEmpty(optVMmSetting.fromHost.name_label))
{
row.ImageIndex = (int)Images.GetIconFor(optVMmSetting.toHost ?? optVMmSetting.fromHost);
@ -797,7 +773,6 @@ namespace XenAdmin.Controls.Wlb
statusLabel.Visible = enableLabel;
applyButton.Visible = true;
//if ((_autoOptEnabled && _powerManagementEnabled) || !PassedRbacChecks())
if (PassedRbacChecks() &&
(!_autoOptEnabled ||
(_autoOptEnabled && !_powerManagementEnabled && IsPowerOnlyRecommendation(_recommendations))))

View File

@ -147,7 +147,6 @@ namespace XenAdmin.Dialogs.Wlb
private XenAdmin.SettingsPanels.WlbOptimizationModePage wlbOptimizationModePage;
private XenAdmin.SettingsPanels.WlbAutomationPage wlbAutomationPage;
//private XenAdmin.SettingsPanels.WlbPowerManagementPage wlbPowerManagementPage;
private XenAdmin.SettingsPanels.WlbThresholdsPage wlbThresholdsPage;
private XenAdmin.SettingsPanels.WlbMetricWeightingPage wlbMetricWeightingPage;
private XenAdmin.SettingsPanels.WlbHostExclusionPage wlbHostExclusionPage;

View File

@ -62,12 +62,6 @@ namespace XenAdmin.Dialogs.Wlb
private bool _runReport;
private bool _isCreedenceOrLater;
private List<string> _midnightRideReports = new List<string>(new []
{
Messages.WLBREPORT_POOL_AUDIT_HISTORY,
Messages.WLBREPORT_POOL_OPTIMIZATION_HISTORY
});
#endregion
@ -564,13 +558,6 @@ namespace XenAdmin.Dialogs.Wlb
}
}
private static XmlElement GetCustomXmlElement(XmlNode root)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml("<root>" + root.InnerXml + "</root>");
return GetCustomXmlElement(xmlDoc.DocumentElement);
}
private static XmlElement GetCustomXmlElement(XmlElement root, string version)
{
XmlElement customXml = GetCustomXmlElement(root);

View File

@ -42157,15 +42157,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Pool Audit Log History.
/// </summary>
public static string WLBREPORT_POOL_AUDIT_HISTORY {
get {
return ResourceManager.GetString("WLBREPORT_POOL_AUDIT_HISTORY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pool Connection Lost.
/// </summary>
@ -42193,15 +42184,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Pool Optimization History.
/// </summary>
public static string WLBREPORT_POOL_OPTIMIZATION_HISTORY {
get {
return ResourceManager.GetString("WLBREPORT_POOL_OPTIMIZATION_HISTORY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to An error occurred when attempting to open the Workload Balancing report window. Please check the report configuration file..
/// </summary>

View File

@ -13895,9 +13895,6 @@ Schedule:
<data name="WLBREPORT_OPTIMIZATION_PERFORMANCE_HISTORY" xml:space="preserve">
<value>Optimization Performance History</value>
</data>
<data name="WLBREPORT_POOL_AUDIT_HISTORY" xml:space="preserve">
<value>Pool Audit Log History</value>
</data>
<data name="WLBREPORT_POOL_CONNECTION_LOST_CAPTION" xml:space="preserve">
<value>Pool Connection Lost</value>
</data>
@ -13907,9 +13904,6 @@ Schedule:
<data name="WLBREPORT_POOL_HEALTH_HISTORY" xml:space="preserve">
<value>Pool Health History</value>
</data>
<data name="WLBREPORT_POOL_OPTIMIZATION_HISTORY" xml:space="preserve">
<value>Pool Optimization History</value>
</data>
<data name="WLBREPORT_REPORT_CONFIG_ERROR" xml:space="preserve">
<value>An error occurred when attempting to open the Workload Balancing report window. Please check the report configuration file.</value>
</data>