コード例 #1
0
        public string FormatHotkey(TextWithHotkey textWithHotkey)
        {
            ArgumentUtility.CheckNotNull("textWithHotkey", textWithHotkey);

            if (!textWithHotkey.Hotkey.HasValue)
            {
                return(null);
            }

            return(char.ToString(char.ToUpper(textWithHotkey.Hotkey.Value)));
        }
コード例 #2
0
        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));
        }