Tidied up the ConsolePanel; moved designer code to the corresponding file and removed setting of virtual field from the constructor.

This commit is contained in:
Konstantina Chremmou 2016-07-01 17:26:14 +01:00
parent 1370508f45
commit 8a8bdc21e6
4 changed files with 119 additions and 87 deletions

View File

@ -0,0 +1,96 @@
namespace XenAdmin.Controls
{
partial class ConsolePanel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConsolePanel));
this.errorLabel = new System.Windows.Forms.Label();
this.RbacWarningPanel = new System.Windows.Forms.Panel();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.lableRbacWarning = new System.Windows.Forms.Label();
this.RbacWarningPanel.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout();
//
// errorLabel
//
resources.ApplyResources(this.errorLabel, "errorLabel");
this.errorLabel.Name = "errorLabel";
//
// RbacWarningPanel
//
this.RbacWarningPanel.BackColor = System.Drawing.Color.Transparent;
this.RbacWarningPanel.Controls.Add(this.tableLayoutPanel3);
resources.ApplyResources(this.RbacWarningPanel, "RbacWarningPanel");
this.RbacWarningPanel.Name = "RbacWarningPanel";
//
// tableLayoutPanel3
//
resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3");
this.tableLayoutPanel3.Controls.Add(this.pictureBox2, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.lableRbacWarning, 1, 0);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
//
// pictureBox2
//
resources.ApplyResources(this.pictureBox2, "pictureBox2");
this.pictureBox2.Image = global::XenAdmin.Properties.Resources._000_WarningAlert_h32bit_32;
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.TabStop = false;
//
// lableRbacWarning
//
resources.ApplyResources(this.lableRbacWarning, "lableRbacWarning");
this.lableRbacWarning.Name = "lableRbacWarning";
//
// ConsolePanel
//
this.Controls.Add(this.RbacWarningPanel);
this.Name = "ConsolePanel";
resources.ApplyResources(this, "$this");
this.RbacWarningPanel.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label errorLabel;
private System.Windows.Forms.Label lableRbacWarning;
private System.Windows.Forms.Panel RbacWarningPanel;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.PictureBox pictureBox2;
}
}

View File

@ -35,37 +35,26 @@ using System.Linq;
using System.Windows.Forms;
using XenAdmin.ConsoleView;
using XenAPI;
using XenAdmin.Core;
using System.Drawing;
namespace XenAdmin.Controls
{
public class ConsolePanel : UserControl
public partial class ConsolePanel : UserControl
{
private const int MAX_ACTIVE_VM_CONSOLES = 10;
private List<VM> activeVMConsoles;
private Dictionary<VM, VNCView> vncViews;
private Label errorLabel;
private static string CouldNotConnect = Messages.VNC_COULD_NOT_CONNECT_CONSOLE;
private static string CouldNotFindConsole = Messages.VNC_COULD_NOT_FIND_CONSOLES;
public VNCView activeVNCView = null;
private Panel RbacWarningPanel;
private TableLayoutPanel tableLayoutPanel3;
private PictureBox pictureBox2;
private Label lableRbacWarning;
public VNCView activeVNCView;
private List<VM> activeVMConsoles = new List<VM>();
private Dictionary<VM, VNCView> vncViews = new Dictionary<VM, VNCView>();
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public ConsolePanel()
: base()
{
InitializeComponent();
this.vncViews = new Dictionary<VM, VNCView>();
this.activeVMConsoles = new List<VM>();
this.Dock = DockStyle.Fill;
pictureBox2.Image = SystemIcons.Warning.ToBitmap();
}
public void PauseAllViews()
@ -350,63 +339,7 @@ namespace XenAdmin.Controls
this.errorLabel.Visible = false;
this.Controls.Remove(this.errorLabel);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConsolePanel));
this.errorLabel = new System.Windows.Forms.Label();
this.RbacWarningPanel = new System.Windows.Forms.Panel();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.lableRbacWarning = new System.Windows.Forms.Label();
this.RbacWarningPanel.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout();
//
// errorLabel
//
resources.ApplyResources(this.errorLabel, "errorLabel");
this.errorLabel.Name = "errorLabel";
//
// RbacWarningPanel
//
this.RbacWarningPanel.BackColor = System.Drawing.Color.Transparent;
this.RbacWarningPanel.Controls.Add(this.tableLayoutPanel3);
resources.ApplyResources(this.RbacWarningPanel, "RbacWarningPanel");
this.RbacWarningPanel.Name = "RbacWarningPanel";
//
// tableLayoutPanel3
//
resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3");
this.tableLayoutPanel3.Controls.Add(this.pictureBox2, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.lableRbacWarning, 1, 0);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
//
// pictureBox2
//
resources.ApplyResources(this.pictureBox2, "pictureBox2");
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.TabStop = false;
//
// lableRbacWarning
//
resources.ApplyResources(this.lableRbacWarning, "lableRbacWarning");
this.lableRbacWarning.Name = "lableRbacWarning";
//
// ConsolePanel
//
this.Controls.Add(this.RbacWarningPanel);
this.Name = "ConsolePanel";
resources.ApplyResources(this, "$this");
this.RbacWarningPanel.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);
}
public void SendCAD()
{
if (this.activeVNCView != null)

View File

@ -112,20 +112,20 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="errorLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>None</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="errorLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="errorLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>82, 70</value>
</data>
@ -142,7 +142,7 @@
<value>errorLabel</value>
</data>
<data name="&gt;&gt;errorLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="tableLayoutPanel3.ColumnCount" type="System.Int32, mscorlib">
<value>2</value>
@ -157,7 +157,7 @@
<value>13, 13</value>
</data>
<data name="pictureBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 39</value>
<value>32, 32</value>
</data>
<data name="pictureBox2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -166,7 +166,7 @@
<value>pictureBox2</value>
</data>
<data name="&gt;&gt;pictureBox2.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox2.Parent" xml:space="preserve">
<value>tableLayoutPanel3</value>
@ -184,10 +184,10 @@
<value>NoControl</value>
</data>
<data name="lableRbacWarning.Location" type="System.Drawing.Point, System.Drawing">
<value>66, 10</value>
<value>51, 10</value>
</data>
<data name="lableRbacWarning.Size" type="System.Drawing.Size, System.Drawing">
<value>545, 196</value>
<value>560, 196</value>
</data>
<data name="lableRbacWarning.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -199,7 +199,7 @@
<value>lableRbacWarning</value>
</data>
<data name="&gt;&gt;lableRbacWarning.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lableRbacWarning.Parent" xml:space="preserve">
<value>tableLayoutPanel3</value>
@ -229,7 +229,7 @@
<value>tableLayoutPanel3</value>
</data>
<data name="&gt;&gt;tableLayoutPanel3.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel3.Parent" xml:space="preserve">
<value>RbacWarningPanel</value>
@ -256,7 +256,7 @@
<value>RbacWarningPanel</value>
</data>
<data name="&gt;&gt;RbacWarningPanel.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;RbacWarningPanel.Parent" xml:space="preserve">
<value>$this</value>
@ -264,7 +264,7 @@
<data name="&gt;&gt;RbacWarningPanel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
@ -274,6 +274,6 @@
<value>ConsolePanel</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -154,6 +154,9 @@
<Compile Include="Controls\ComboBoxes\CPUTopologyComboBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ConsolePanel.Designer.cs">
<DependentUpon>ConsolePanel.cs</DependentUpon>
</Compile>
<Compile Include="Controls\DataGridViewEx\DataGridViewEx.cs">
<SubType>Component</SubType>
</Compile>