From 26abbcd6154049d8e8dea2ccbcaf9a1c66c685db Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Wed, 19 May 2021 11:59:05 +0100 Subject: [PATCH] Removed overrides that were doing the same as the base class methods. Signed-off-by: Konstantina Chremmou --- XenAdmin/Controls/ComboBoxes/CDChanger.cs | 30 +------------ .../Controls/ComboBoxes/ISODropDownBox.cs | 43 +++++++++---------- .../NewVMWizard/Page_InstallationMedia.cs | 2 +- 3 files changed, 22 insertions(+), 53 deletions(-) diff --git a/XenAdmin/Controls/ComboBoxes/CDChanger.cs b/XenAdmin/Controls/ComboBoxes/CDChanger.cs index a85782013..396974b96 100644 --- a/XenAdmin/Controls/ComboBoxes/CDChanger.cs +++ b/XenAdmin/Controls/ComboBoxes/CDChanger.cs @@ -54,7 +54,7 @@ namespace XenAdmin.Controls if (cdrom != null) cdrom.PropertyChanged += cdrom_PropertyChanged; - refreshAll(); + RefreshAll(); } } @@ -78,20 +78,6 @@ namespace XenAdmin.Controls } } - protected override void RefreshSRs() - { - BeginUpdate(); - try - { - Items.Clear(); - base.RefreshSRs(); - } - finally - { - EndUpdate(); - } - } - public override void SelectCD() { if (cdrom == null || cdrom.empty || cdrom.VDI == null) @@ -104,20 +90,6 @@ namespace XenAdmin.Controls base.SelectCD(); } - public override void refreshAll() - { - if (!DroppedDown) - { - RefreshSRs(); - SelectCD(); - refreshOnClose = false; - } - else - { - refreshOnClose = true; - } - } - protected override void OnSelectionChangeCommitted(EventArgs e) { // let the base class take care of skipping the SR headings (CA-40779) diff --git a/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs b/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs index d1e22c6af..849ba4065 100644 --- a/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs +++ b/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs @@ -75,21 +75,7 @@ namespace XenAdmin.Controls base.Dispose(disposing); } - private void RefreshSRs_() - { - BeginUpdate(); - try - { - Items.Clear(); - RefreshSRs(); - } - finally - { - EndUpdate(); - } - } - - protected virtual void RefreshSRs() + private void RefreshSRs() { Program.AssertOnEventThread(); @@ -251,7 +237,7 @@ namespace XenAdmin.Controls if (connection != null) { RegisterEvents(); - refreshAll(); + RefreshAll(); } } get @@ -320,14 +306,25 @@ namespace XenAdmin.Controls sr.PropertyChanged += sr_PropertyChanged; } - Program.Invoke(this, refreshAll); + Program.Invoke(this, RefreshAll); } - public virtual void refreshAll() + public void RefreshAll() { if (!DroppedDown) { - RefreshSRs_(); + BeginUpdate(); + + try + { + Items.Clear(); + RefreshSRs(); + } + finally + { + EndUpdate(); + } + SelectCD(); refreshOnClose = false; } @@ -341,7 +338,7 @@ namespace XenAdmin.Controls { if (e.PropertyName == "VDIs" || e.PropertyName == "PBDs") { - refreshAll(); + RefreshAll(); } } @@ -349,7 +346,7 @@ namespace XenAdmin.Controls { if (e.PropertyName == "currently_attached") { - refreshAll(); + RefreshAll(); } } @@ -365,7 +362,7 @@ namespace XenAdmin.Controls { if (e.PropertyName == "VBDs" || e.PropertyName == "resident_on" || e.PropertyName == "affinity") { - refreshAll(); + RefreshAll(); } } @@ -411,7 +408,7 @@ namespace XenAdmin.Controls base.OnDropDownClosed(e); if (refreshOnClose) - refreshAll(); + RefreshAll(); } protected override bool IsItemNonSelectable(object o) diff --git a/XenAdmin/Wizards/NewVMWizard/Page_InstallationMedia.cs b/XenAdmin/Wizards/NewVMWizard/Page_InstallationMedia.cs index 61f2fbfe6..712a3dfac 100644 --- a/XenAdmin/Wizards/NewVMWizard/Page_InstallationMedia.cs +++ b/XenAdmin/Wizards/NewVMWizard/Page_InstallationMedia.cs @@ -173,7 +173,7 @@ namespace XenAdmin.Wizards.NewVMWizard { CdDropDownBox.vm = m_template; - CdDropDownBox.refreshAll(); + CdDropDownBox.RefreshAll(); RegisterBespokeEventsAgainstCdDropDownBox();