public string FormatHotkey(TextWithHotkey textWithHotkey) { ArgumentUtility.CheckNotNull("textWithHotkey", textWithHotkey); if (!textWithHotkey.Hotkey.HasValue) { return(null); } return(char.ToString(char.ToUpper(textWithHotkey.Hotkey.Value))); }
public string FormatText(TextWithHotkey textWithHotkey, bool encode) { ArgumentUtility.CheckNotNull("textWithHotkey", textWithHotkey); var textParts = GetTextParts(textWithHotkey.Text, textWithHotkey.HotkeyIndex); if (encode) { textParts = GetHtmlEncodedTextParts(textParts); } return(GetFormattedString(textParts)); }