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