-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAdornmentFactory.cs
41 lines (35 loc) · 1.49 KB
/
AdornmentFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Editor;
namespace BackgroundColorFix
{
[Export(typeof(IWpfTextViewCreationListener))]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Document)]
sealed class BackgroundColorAdornmentFactory : IWpfTextViewCreationListener
{
[Export(typeof(AdornmentLayerDefinition))]
[Name("BackgroundColorFix")]
[Order(Before = PredefinedAdornmentLayers.Selection)]
[TextViewRole(PredefinedTextViewRoles.Document)]
AdornmentLayerDefinition AdornmentLayer = null;
[Import]
IViewTagAggregatorFactoryService AggregatorService = null;
[Import]
IClassificationFormatMapService FormatMapService = null;
[Import]
IVsFontsAndColorsInformationService FCService = null;
[Import]
IVsEditorAdaptersFactoryService AdaptersService = null;
public void TextViewCreated(IWpfTextView textView)
{
new BackgroundColorVisualManager(textView,
AggregatorService.CreateTagAggregator<IClassificationTag>(textView),
FormatMapService.GetClassificationFormatMap(textView),
FCService, AdaptersService);
}
}
}