Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
			void Add(TaggedText taggedText) {
				content.Append(taggedText.Text);
				contentTagged.Add(taggedText);
			}
Exemplo n.º 4
0
		string ToString(TaggedText[] parts) {
			var sb = new StringBuilder();
			foreach (var taggedText in parts)
				sb.Append(taggedText.Text);
			return sb.ToString();
		}