CA-140181: Inconsistent name displaying when it contains symbol '&’ and becomes hotkey.

Now using the EscapeAmpersands string extension method. Also resolved the custom fields display issue in the same way.

Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
This commit is contained in:
Callum McIntyre 2016-08-23 11:33:24 +01:00
parent 14288ede3a
commit cf4ed293ba
2 changed files with 2 additions and 3 deletions

View File

@ -243,7 +243,7 @@ namespace XenAdmin.SettingsPanels
{
// Create the display label
Label lblKey = new Label();
lblKey.Text = customFieldDefinition.Name;
lblKey.Text = customFieldDefinition.Name.EscapeAmpersands();
lblKey.Margin = new Padding(3, 7, 3, 3);
lblKey.Font = Program.DefaultFont;
lblKey.Width = (int)tableLayoutPanel.ColumnStyles[0].Width;

View File

@ -360,10 +360,9 @@ namespace XenAdmin.TabPages
private void DeleteGraph()
{
var formattableName = GraphList.SelectedGraph.DisplayName.Replace("&", "&&");
using (ThreeButtonDialog dlog = new ThreeButtonDialog(
new ThreeButtonDialog.Details(SystemIcons.Warning,
string.Format(Messages.DELETE_GRAPH_MESSAGE, formattableName),
string.Format(Messages.DELETE_GRAPH_MESSAGE, GraphList.SelectedGraph.DisplayName.EscapeAmpersands()),
Messages.XENCENTER),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo))