CP-36392: Remove duplicate field in MultipleDvdIsoList.cs

Also remove `VM` from designer

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-09-17 16:09:58 +01:00
parent 157fe77f8f
commit a61f61d66f
No known key found for this signature in database
GPG Key ID: 55F556F9A25CB037
3 changed files with 11 additions and 16 deletions

View File

@ -207,7 +207,6 @@ namespace XenAdmin.ConsoleView
this.multipleDvdIsoList1.LabelSingleDvdForeColor = System.Drawing.SystemColors.ControlText;
this.multipleDvdIsoList1.LinkLabelLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.multipleDvdIsoList1.Name = "multipleDvdIsoList1";
this.multipleDvdIsoList1.VM = null;
//
// pictureBox1
//

View File

@ -52,22 +52,19 @@ namespace XenAdmin.Controls
InitializeComponent();
}
private VM vm;
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public VM VM
{
set
{
DeregisterEvents();
cdChanger1.VM = value;
vm = value;
if (vm != null)
vm.PropertyChanged += vm_PropertyChanged;
if (value != null)
cdChanger1.VM.PropertyChanged += vm_PropertyChanged;
refreshDrives();
}
get
{
return cdChanger1.VM;
}
get => cdChanger1.VM;
}
#region Designer browsable properties
@ -100,17 +97,17 @@ namespace XenAdmin.Controls
internal virtual void DeregisterEvents()
{
if (vm == null)
if (VM == null)
return;
// remove VM listeners
vm.PropertyChanged -= vm_PropertyChanged;
VM.PropertyChanged -= vm_PropertyChanged;
// remove cache listener
vm.Connection.CachePopulated -= CachePopulatedMethod;
VM.Connection.CachePopulated -= CachePopulatedMethod;
// remove VBD listeners
var vbds = vm.Connection.ResolveAll(VM.VBDs);
var vbds = VM.Connection.ResolveAll(VM.VBDs);
foreach (var vbd in vbds.Where(vbd => vbd.IsCDROM() || vbd.IsFloppyDrive()))
{
@ -178,7 +175,7 @@ namespace XenAdmin.Controls
labelSingleDvd.Visible = false;
linkLabel1.Visible = false;
panel1.Visible = false;
newCDLabel.Visible = vm != null && !vm.is_control_domain;
newCDLabel.Visible = VM != null && !VM.is_control_domain;
}
else if (comboBoxDrive.Items.Count == 1)

View File

@ -348,7 +348,6 @@ namespace XenAdmin.TabPages
this.multipleDvdIsoList1.LabelSingleDvdForeColor = System.Drawing.SystemColors.ControlText;
this.multipleDvdIsoList1.LinkLabelLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))));
this.multipleDvdIsoList1.Name = "multipleDvdIsoList1";
this.multipleDvdIsoList1.VM = null;
//
// dataGridViewTextBoxColumn1
//