protected override string GetFormattingString(FormattingType type, FormattingPosition position)
        {
            switch (type)
            {
            case FormattingType.Italic:
                return("~");

            case FormattingType.Bold:
                return("*");

            case FormattingType.Underline:
                return("_");

            case FormattingType.Strikethrough:
                return("-");

            case FormattingType.Quote:
                return(string.Empty);

            case FormattingType.Monospace:
                return("`");

            case FormattingType.MonospaceBlock:
                return("```\n");

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Example #2
0
 /// <summary>
 /// Returns the formatting string expected by the chat server for the given formatting type.
 /// </summary>
 /// <param name="type">The type of formatting that should be done.</param>
 /// <param name="position">The position of the formatter in the text block to be formatted.</param>
 /// <returns></returns>
 protected abstract string GetFormattingString(FormattingType type, FormattingPosition position);