private static Run CreateRun(TaggedText text) { var run = new Run(text.ToString()); var classificationTypeName = ClassificationTags.GetClassificationTypeName(text.Tag); run.Foreground = new SolidColorBrush(CodeHighlightColors.GetColor(classificationTypeName)); return run; }
public static string ToVisibleDisplayString(this TaggedText part, bool includeLeftToRightMarker) { var text = part.ToString(); if (includeLeftToRightMarker) { var classificationTypeName = part.Tag.ToClassificationTypeName(); if (classificationTypeName == ClassificationTypeNames.Punctuation || classificationTypeName == ClassificationTypeNames.WhiteSpace) { text = LeftToRightMarkerPrefix + text; } } return(text); }
void Add(TaggedText taggedText) { content.Append(taggedText.Text); contentTagged.Add(taggedText); }
string ToString(TaggedText[] parts) { var sb = new StringBuilder(); foreach (var taggedText in parts) sb.Append(taggedText.Text); return sb.ToString(); }