mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 15:29:26 +01:00
Added option for three columns on the GeneralTabPage panels. Refactored methods adding entries.
Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
parent
1e89de1c7c
commit
f9198e477d
40
XenAdmin/Controls/PDSection.Designer.cs
generated
40
XenAdmin/Controls/PDSection.Designer.cs
generated
@ -30,10 +30,11 @@ namespace XenAdmin.Controls
|
|||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDSection));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDSection));
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
@ -43,6 +44,7 @@ namespace XenAdmin.Controls
|
|||||||
this.dataGridViewEx1 = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx();
|
this.dataGridViewEx1 = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx();
|
||||||
this.KeyColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.KeyColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.ValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.ValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.ColumnNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.panel1.SuspendLayout();
|
this.panel1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.chevron)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.chevron)).BeginInit();
|
||||||
this.contextMenuStrip1.SuspendLayout();
|
this.contextMenuStrip1.SuspendLayout();
|
||||||
@ -105,22 +107,23 @@ namespace XenAdmin.Controls
|
|||||||
this.dataGridViewEx1.ColumnHeadersVisible = false;
|
this.dataGridViewEx1.ColumnHeadersVisible = false;
|
||||||
this.dataGridViewEx1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
this.dataGridViewEx1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
this.KeyColumn,
|
this.KeyColumn,
|
||||||
this.ValueColumn});
|
this.ValueColumn,
|
||||||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
this.ColumnNotes});
|
||||||
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
|
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||||
dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window;
|
||||||
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
|
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Window;
|
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.ControlText;
|
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Window;
|
||||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
this.dataGridViewEx1.DefaultCellStyle = dataGridViewCellStyle3;
|
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||||
|
this.dataGridViewEx1.DefaultCellStyle = dataGridViewCellStyle4;
|
||||||
resources.ApplyResources(this.dataGridViewEx1, "dataGridViewEx1");
|
resources.ApplyResources(this.dataGridViewEx1, "dataGridViewEx1");
|
||||||
this.dataGridViewEx1.GridColor = System.Drawing.SystemColors.Control;
|
this.dataGridViewEx1.GridColor = System.Drawing.SystemColors.Control;
|
||||||
this.dataGridViewEx1.HideSelection = true;
|
this.dataGridViewEx1.HideSelection = true;
|
||||||
this.dataGridViewEx1.Name = "dataGridViewEx1";
|
this.dataGridViewEx1.Name = "dataGridViewEx1";
|
||||||
this.dataGridViewEx1.ReadOnly = true;
|
this.dataGridViewEx1.ReadOnly = true;
|
||||||
dataGridViewCellStyle4.Padding = new System.Windows.Forms.Padding(5);
|
dataGridViewCellStyle5.Padding = new System.Windows.Forms.Padding(5);
|
||||||
this.dataGridViewEx1.RowsDefaultCellStyle = dataGridViewCellStyle4;
|
this.dataGridViewEx1.RowsDefaultCellStyle = dataGridViewCellStyle5;
|
||||||
this.dataGridViewEx1.ShowCellToolTips = false;
|
this.dataGridViewEx1.ShowCellToolTips = false;
|
||||||
this.dataGridViewEx1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewEx1_CellContentClick);
|
this.dataGridViewEx1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewEx1_CellContentClick);
|
||||||
this.dataGridViewEx1.SelectionChanged += new System.EventHandler(this.dataGridViewEx1_SelectionChanged);
|
this.dataGridViewEx1.SelectionChanged += new System.EventHandler(this.dataGridViewEx1_SelectionChanged);
|
||||||
@ -141,7 +144,6 @@ namespace XenAdmin.Controls
|
|||||||
//
|
//
|
||||||
// ValueColumn
|
// ValueColumn
|
||||||
//
|
//
|
||||||
this.ValueColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
|
||||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
|
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
|
||||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||||
this.ValueColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
this.ValueColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
||||||
@ -151,6 +153,17 @@ namespace XenAdmin.Controls
|
|||||||
this.ValueColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False;
|
this.ValueColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False;
|
||||||
this.ValueColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
this.ValueColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
//
|
//
|
||||||
|
// ColumnNotes
|
||||||
|
//
|
||||||
|
this.ColumnNotes.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
|
||||||
|
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
|
||||||
|
this.ColumnNotes.DefaultCellStyle = dataGridViewCellStyle3;
|
||||||
|
resources.ApplyResources(this.ColumnNotes, "ColumnNotes");
|
||||||
|
this.ColumnNotes.Name = "ColumnNotes";
|
||||||
|
this.ColumnNotes.ReadOnly = true;
|
||||||
|
this.ColumnNotes.Resizable = System.Windows.Forms.DataGridViewTriState.False;
|
||||||
|
this.ColumnNotes.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
|
//
|
||||||
// PDSection
|
// PDSection
|
||||||
//
|
//
|
||||||
this.BackColor = System.Drawing.Color.Gainsboro;
|
this.BackColor = System.Drawing.Color.Gainsboro;
|
||||||
@ -179,5 +192,6 @@ namespace XenAdmin.Controls
|
|||||||
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
|
||||||
private System.Windows.Forms.DataGridViewTextBoxColumn KeyColumn;
|
private System.Windows.Forms.DataGridViewTextBoxColumn KeyColumn;
|
||||||
private System.Windows.Forms.DataGridViewTextBoxColumn ValueColumn;
|
private System.Windows.Forms.DataGridViewTextBoxColumn ValueColumn;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnNotes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,16 +78,19 @@ namespace XenAdmin.Controls
|
|||||||
public PDSection()
|
public PDSection()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetDefaultValues();
|
|
||||||
Contract();
|
SectionTitle = Messages.PDSECTION_TITLE;
|
||||||
|
IsExpanded = true;
|
||||||
|
Collapse();
|
||||||
MinimumSize = new Size(0, Height);
|
MinimumSize = new Size(0, Height);
|
||||||
|
|
||||||
dataGridViewEx1.LostFocus += dataGridViewEx1_LostFocus;
|
dataGridViewEx1.LostFocus += dataGridViewEx1_LostFocus;
|
||||||
dataGridViewEx1.GotFocus += dataGridViewEx1_GotFocus;
|
dataGridViewEx1.GotFocus += dataGridViewEx1_GotFocus;
|
||||||
|
|
||||||
if (!Application.RenderWithVisualStyles)
|
if (!Application.RenderWithVisualStyles)
|
||||||
{
|
{
|
||||||
panel1.BackColor = SystemColors.Control;
|
panel1.BackColor = SystemColors.Control;
|
||||||
this.BackColor = SystemColors.ControlDark;
|
BackColor = SystemColors.ControlDark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +231,7 @@ namespace XenAdmin.Controls
|
|||||||
private void panel1_MouseDoubleClick(object sender, MouseEventArgs e)
|
private void panel1_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (IsExpanded)
|
if (IsExpanded)
|
||||||
Contract();
|
Collapse();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Expand();
|
Expand();
|
||||||
@ -239,7 +242,7 @@ namespace XenAdmin.Controls
|
|||||||
private void chevron_Click(object sender, EventArgs e)
|
private void chevron_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (IsExpanded)
|
if (IsExpanded)
|
||||||
Contract();
|
Collapse();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Expand();
|
Expand();
|
||||||
@ -263,23 +266,14 @@ namespace XenAdmin.Controls
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private void SetDefaultValues()
|
|
||||||
{
|
|
||||||
SectionTitle = Messages.PDSECTION_TITLE;
|
|
||||||
IsExpanded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RunCellCommandOrAction(DataGridViewCell cell)
|
private void RunCellCommandOrAction(DataGridViewCell cell)
|
||||||
{
|
{
|
||||||
if (cell == null)
|
if (cell == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var command = cell.Tag as Command;
|
if (cell.Tag is Command command)
|
||||||
if (command != null)
|
|
||||||
command.Run();
|
command.Run();
|
||||||
|
else if (cell.Tag is Action action)
|
||||||
var action = cell.Tag as Action;
|
|
||||||
if (action != null)
|
|
||||||
action.Invoke();
|
action.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,12 +283,12 @@ namespace XenAdmin.Controls
|
|||||||
{
|
{
|
||||||
int newHeight = dataGridViewEx1.Rows.GetRowsHeight(DataGridViewElementStates.Visible);
|
int newHeight = dataGridViewEx1.Rows.GetRowsHeight(DataGridViewElementStates.Visible);
|
||||||
|
|
||||||
int valueColWidth = dataGridViewEx1.Width - dataGridViewEx1.Columns[KeyColumn.Index].Width;
|
int actualWidth = dataGridViewEx1.Width - KeyColumn.Width;
|
||||||
int preferredValueColWidth =
|
|
||||||
dataGridViewEx1.Columns[ValueColumn.Index].GetPreferredWidth(
|
|
||||||
DataGridViewAutoSizeColumnMode.AllCells, true);
|
|
||||||
|
|
||||||
int horizontalScrollBarHeight = preferredValueColWidth - 1 >= valueColWidth
|
int preferredWidth = ValueColumn.GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true) +
|
||||||
|
ColumnNotes.GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true);
|
||||||
|
|
||||||
|
int horizontalScrollBarHeight = preferredWidth - 2 >= actualWidth
|
||||||
? dataGridViewEx1.HorizontalScrollBarHeight
|
? dataGridViewEx1.HorizontalScrollBarHeight
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
@ -321,15 +315,28 @@ namespace XenAdmin.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddRow(DataGridViewRow r)
|
private void AddRow(DataGridViewCell keyCell, DataGridViewCell valueCell, DataGridViewCell noteCell, params ToolStripMenuItem[] contextMenuItems)
|
||||||
{
|
{
|
||||||
|
var r = new DataGridViewExRow();
|
||||||
|
r.Cells.AddRange(keyCell, valueCell, noteCell ?? new DataGridViewTextBoxCell());
|
||||||
|
r.Tag = contextMenuItems;
|
||||||
|
|
||||||
dataGridViewEx1.Rows.Add(r);
|
dataGridViewEx1.Rows.Add(r);
|
||||||
|
|
||||||
if (inLayout)
|
if (inLayout)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RefreshHeight();
|
RefreshHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DataGridViewTextBoxCell CreateKeyCell(string key)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(key))
|
||||||
|
key += Messages.GENERAL_PAGE_KVP_SEPARATOR;
|
||||||
|
var cell = new DataGridViewTextBoxCell { Value = key };
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
private void ToggleExpandedState(bool expand)
|
private void ToggleExpandedState(bool expand)
|
||||||
{
|
{
|
||||||
if (IsExpanded == expand)
|
if (IsExpanded == expand)
|
||||||
@ -346,113 +353,54 @@ namespace XenAdmin.Controls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void Contract()
|
public void Collapse()
|
||||||
{
|
{
|
||||||
ToggleExpandedState(false);
|
ToggleExpandedState(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Expand()
|
public void Expand()
|
||||||
{
|
{
|
||||||
ValueColumn.MinimumWidth = 5;
|
|
||||||
HelpersGUI.ResizeGridViewColumnToAllCells(ValueColumn);
|
|
||||||
ToggleExpandedState(true);
|
ToggleExpandedState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataGridViewExRow CreateRow(string Key, string Value)
|
public void AddEntry(string key, string value, params ToolStripMenuItem[] contextMenuItems)
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(Key))
|
var valueCell = new DataGridViewTextBoxCell { Value = value };
|
||||||
Key += Messages.GENERAL_PAGE_KVP_SEPARATOR;
|
AddRow(CreateKeyCell(key), valueCell, null, contextMenuItems);
|
||||||
DataGridViewExRow r = new DataGridViewExRow();
|
|
||||||
r.CreateCells(dataGridViewEx1);
|
|
||||||
r.Cells[0].Value = Key;
|
|
||||||
r.Cells[1].Value = Value;
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddEntry(string key, string value, Color fontColor, params ToolStripMenuItem[] contextMenuItems)
|
||||||
public void AddEntry(string Key, string Value, params ToolStripMenuItem[] contextMenuItems)
|
|
||||||
{
|
{
|
||||||
var r = CreateRow(Key, Value);
|
var valueCell = new DataGridViewTextBoxCell { Value = value };
|
||||||
r.Tag = contextMenuItems;
|
AddRow(CreateKeyCell(key), valueCell, null, contextMenuItems);
|
||||||
AddRow(r);
|
valueCell.Style.ForeColor = fontColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEntry(string Key, string Value, string toolTipText, params ToolStripMenuItem[] contextMenuItems)
|
public void AddEntry(string key, FolderListItem value, params ToolStripMenuItem[] contextMenuItems)
|
||||||
{
|
{
|
||||||
AddEntry(Key, Value, contextMenuItems);
|
var valueCell = new FolderCell(value); // CA-33311
|
||||||
if (toolTipText != Key)
|
AddRow(CreateKeyCell(key), valueCell, null, contextMenuItems);
|
||||||
dataGridViewEx1.Rows[dataGridViewEx1.RowCount - 1].Cells[0].ToolTipText = toolTipText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEntry(string Key, string Value, Color fontColor)
|
internal void AddEntryLink(string key, string value, Command command, params ToolStripMenuItem[] contextMenuItems)
|
||||||
{
|
{
|
||||||
var r = CreateRow(Key, Value);
|
var valueCell = new DataGridViewLinkCell { Value = value, Tag = command };
|
||||||
r.Cells[1].Style.ForeColor = fontColor;
|
AddRow(CreateKeyCell(key), valueCell, null, contextMenuItems);
|
||||||
AddRow(r);
|
|
||||||
dataGridViewEx1.DefaultCellStyle = new DataGridViewCellStyle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEntry(string Key, string Value, Color fontColor, params ToolStripMenuItem[] contextMenuItems)
|
internal void AddEntryLink(string key, string value, Action action, params ToolStripMenuItem[] contextMenuItems)
|
||||||
{
|
{
|
||||||
var r = CreateRow(Key, Value);
|
var valueCell = new DataGridViewLinkCell { Value = value, Tag = action };
|
||||||
r.Cells[1].Style.ForeColor = fontColor;
|
AddRow(CreateKeyCell(key), valueCell, null, contextMenuItems);
|
||||||
r.Tag = contextMenuItems;
|
|
||||||
AddRow(r);
|
|
||||||
dataGridViewEx1.DefaultCellStyle = new DataGridViewCellStyle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEntry(string Key, FolderListItem Value, params ToolStripMenuItem[] contextMenuItems)
|
internal void AddEntryWithNoteLink(string key, string value, string note, Action action, params ToolStripMenuItem[] contextMenuItems)
|
||||||
{
|
{
|
||||||
// Special case for folders: CA-33311
|
var valueCell = new DataGridViewTextBoxCell { Value = value };
|
||||||
|
var noteCell = new DataGridViewLinkCell { Value = note, Tag = action };
|
||||||
if (!String.IsNullOrEmpty(Key))
|
AddRow(CreateKeyCell(key), valueCell, noteCell, contextMenuItems);
|
||||||
Key += Messages.GENERAL_PAGE_KVP_SEPARATOR;
|
|
||||||
DataGridViewExRow r = new DataGridViewExRow();
|
|
||||||
r.Cells.Add(new DataGridViewTextBoxCell());
|
|
||||||
r.Cells[0].Value = Key;
|
|
||||||
r.Cells.Add(new FolderCell(Value));
|
|
||||||
r.Tag = contextMenuItems;
|
|
||||||
AddRow(r);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEntry(string Key, string Value, bool visible, params ToolStripMenuItem[] contextMenuItems)
|
|
||||||
{
|
|
||||||
var r = CreateRow(Key, Value);
|
|
||||||
r.Tag = contextMenuItems;
|
|
||||||
r.Visible = visible;
|
|
||||||
AddRow(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
internal void AddEntryLink(string Key, string Value, Command command, params ToolStripMenuItem[] contextMenuItems)
|
|
||||||
{
|
|
||||||
if (!String.IsNullOrEmpty(Key))
|
|
||||||
Key += Messages.GENERAL_PAGE_KVP_SEPARATOR;
|
|
||||||
DataGridViewExRow r = new DataGridViewExRow();
|
|
||||||
r.CreateCells(dataGridViewEx1);
|
|
||||||
r.Cells[0].Value = Key;
|
|
||||||
r.Cells[1] = new DataGridViewLinkCell();
|
|
||||||
r.Cells[1].Value = Value;
|
|
||||||
r.Cells[1].Tag = command;
|
|
||||||
r.Tag = contextMenuItems;
|
|
||||||
AddRow(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void AddEntryLink(string Key, string Value, Action action, params ToolStripMenuItem[] contextMenuItems)
|
|
||||||
{
|
|
||||||
if (!String.IsNullOrEmpty(Key))
|
|
||||||
Key += Messages.GENERAL_PAGE_KVP_SEPARATOR;
|
|
||||||
DataGridViewExRow r = new DataGridViewExRow();
|
|
||||||
r.CreateCells(dataGridViewEx1);
|
|
||||||
r.Cells[0].Value = Key;
|
|
||||||
r.Cells[1] = new DataGridViewLinkCell();
|
|
||||||
r.Cells[1].Value = Value;
|
|
||||||
r.Cells[1].Tag = action;
|
|
||||||
r.Tag = contextMenuItems;
|
|
||||||
AddRow(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void UpdateEntryValueWithKey(string Key, string newValue, bool visible)
|
public void UpdateEntryValueWithKey(string Key, string newValue, bool visible)
|
||||||
{
|
{
|
||||||
List<DataGridViewExRow> matchingRows = (from DataGridViewExRow row in dataGridViewEx1.Rows
|
List<DataGridViewExRow> matchingRows = (from DataGridViewExRow row in dataGridViewEx1.Rows
|
||||||
@ -471,7 +419,7 @@ namespace XenAdmin.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void fixFirstColumnWidth(int width)
|
internal void FixFirstColumnWidth(int width)
|
||||||
{
|
{
|
||||||
dataGridViewEx1.Columns[0].Width = width;
|
dataGridViewEx1.Columns[0].Width = width;
|
||||||
}
|
}
|
||||||
|
@ -273,6 +273,15 @@
|
|||||||
<data name="ValueColumn.HeaderText" xml:space="preserve">
|
<data name="ValueColumn.HeaderText" xml:space="preserve">
|
||||||
<value>Value</value>
|
<value>Value</value>
|
||||||
</data>
|
</data>
|
||||||
|
<metadata name="ColumnNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<data name="ColumnNotes.HeaderText" xml:space="preserve">
|
||||||
|
<value>Notes</value>
|
||||||
|
</data>
|
||||||
|
<data name="ColumnNotes.Width" type="System.Int32, mscorlib">
|
||||||
|
<value>5</value>
|
||||||
|
</data>
|
||||||
<data name="dataGridViewEx1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
<data name="dataGridViewEx1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
<value>Fill</value>
|
<value>Fill</value>
|
||||||
</data>
|
</data>
|
||||||
@ -292,7 +301,7 @@
|
|||||||
<value>dataGridViewEx1</value>
|
<value>dataGridViewEx1</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>dataGridViewEx1.Type" xml:space="preserve">
|
<data name=">>dataGridViewEx1.Type" xml:space="preserve">
|
||||||
<value>XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>XenAdmin.Controls.DataGridViewEx.DataGridViewEx, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>dataGridViewEx1.Parent" xml:space="preserve">
|
<data name=">>dataGridViewEx1.Parent" xml:space="preserve">
|
||||||
<value>$this</value>
|
<value>$this</value>
|
||||||
@ -330,6 +339,12 @@
|
|||||||
<data name=">>ValueColumn.Type" xml:space="preserve">
|
<data name=">>ValueColumn.Type" xml:space="preserve">
|
||||||
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name=">>ColumnNotes.Name" xml:space="preserve">
|
||||||
|
<value>ColumnNotes</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>ColumnNotes.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
<data name=">>$this.Name" xml:space="preserve">
|
<data name=">>$this.Name" xml:space="preserve">
|
||||||
<value>PDSection</value>
|
<value>PDSection</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -538,9 +538,8 @@ namespace XenAdmin.TabPages
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CustomFieldWrapper cfWrapper = new CustomFieldWrapper(xenObject, customField.Definition);
|
var cfWrapper = new CustomFieldWrapper(xenObject, customField.Definition);
|
||||||
|
s.AddEntry(customField.Definition.Name, cfWrapper.ToString(), editValue);
|
||||||
s.AddEntry(customField.Definition.Name.Ellipsise(30), cfWrapper.ToString(), customField.Definition.Name, editValue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -754,10 +753,10 @@ namespace XenAdmin.TabPages
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (repairable)
|
if (repairable)
|
||||||
s.AddEntry(" " + Helpers.GetName(host).Ellipsise(30),
|
s.AddEntry(Helpers.GetName(host).Ellipsise(30),
|
||||||
Messages.REPAIR_SR_DIALOG_CONNECTION_MISSING, Color.Red, repairItem);
|
Messages.REPAIR_SR_DIALOG_CONNECTION_MISSING, Color.Red, repairItem);
|
||||||
else
|
else
|
||||||
s.AddEntry(" " + Helpers.GetName(host).Ellipsise(30),
|
s.AddEntry(Helpers.GetName(host).Ellipsise(30),
|
||||||
Messages.REPAIR_SR_DIALOG_CONNECTION_MISSING, Color.Red);
|
Messages.REPAIR_SR_DIALOG_CONNECTION_MISSING, Color.Red);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -1017,9 +1016,10 @@ namespace XenAdmin.TabPages
|
|||||||
var ss = new GeneralTabLicenseStatusStringifier(licenseStatus);
|
var ss = new GeneralTabLicenseStatusStringifier(licenseStatus);
|
||||||
s.AddEntry(Messages.LICENSE_STATUS,
|
s.AddEntry(Messages.LICENSE_STATUS,
|
||||||
licenseStatus.Updated ? ss.ExpiryStatus : Messages.GENERAL_LICENSE_QUERYING, editItem);
|
licenseStatus.Updated ? ss.ExpiryStatus : Messages.GENERAL_LICENSE_QUERYING, editItem);
|
||||||
|
|
||||||
|
if (ss.ShowExpiryDate)
|
||||||
s.AddEntry(FriendlyName("host.license_params-expiry"),
|
s.AddEntry(FriendlyName("host.license_params-expiry"),
|
||||||
licenseStatus.Updated ? ss.ExpiryDate : Messages.GENERAL_LICENSE_QUERYING,
|
licenseStatus.Updated ? ss.ExpiryDate : Messages.GENERAL_LICENSE_QUERYING,
|
||||||
ss.ShowExpiryDate,
|
|
||||||
editItem);
|
editItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2110,7 +2110,7 @@ namespace XenAdmin.TabPages
|
|||||||
if (expand(s))
|
if (expand(s))
|
||||||
s.Expand();
|
s.Expand();
|
||||||
else
|
else
|
||||||
s.Contract();
|
s.Collapse();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@ namespace XenAdmin.TabPages
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
base.Text = Messages.WORKLOAD_BALANCING;
|
base.Text = Messages.WORKLOAD_BALANCING;
|
||||||
pdSectionConfiguration.fixFirstColumnWidth(200);
|
pdSectionConfiguration.FixFirstColumnWidth(200);
|
||||||
|
|
||||||
RefreshControls();
|
RefreshControls();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user