public FrameworkElement CreateTextElement(TreeViewNodeClassifierContext context, string contentType, bool filterOutNewLines, bool useNewFormatter)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (contentType == null)
            {
                throw new ArgumentNullException(nameof(contentType));
            }
            var ct = contentTypeRegistryService.GetContentType(contentType);

            if (ct == null)
            {
                throw new ArgumentException($"Invalid content type: {contentType}");
            }

            ITextClassifierAggregator aggregator;

            if (!toAggregator.TryGetValue(ct, out aggregator))
            {
                toAggregator.Add(ct, aggregator = textClassifierAggregatorService.Create(ct));
            }
            try {
                tagsList.AddRange(aggregator.GetTags(context));
                return(TextElementFactory.Create(classificationFormatMap, context.Text, tagsList, useNewFormatter: useNewFormatter, filterOutNewLines: filterOutNewLines));
            }
            finally {
                tagsList.Clear();
            }
        }
 public FrameworkElement CreateTextElement(TreeViewNodeClassifierContext context, string contentType, TextElementFlags flags) =>
 textElementProvider.CreateTextElement(classificationFormatMap, context, contentType, flags);