Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VS 2010 MEF: Fonts and Color settings cannot be changed for EditorFormatDefinition used in BuildOutput

$
0
0

Hi,
I tried to add some colorizing to the build output pane and implemented an IClassifier, ContentType BuildOutput.Everything works fine but when I change the color settings with the Tools->Options Font and Color Dialog, the build output still appears with the default colors set in the format's ctor. Even by changing the color values via the IEditorFormatMapService programatically the output is still unchanged. When I change the ContentType to text or something else then it works great, just the build output ignores the user settings. 

 [Export(typeof (IClassifierProvider))]
 [ContentType("BuildOutput")]internalclass ErrorClassifierProvider : IClassifierProvider
 {
 [Import] internal SVsServiceProvider ServiceProvider = null;

 [Import] internal IClassificationTypeRegistryService ClassificationRegistry = null; // Set via MEFpublic IClassifier GetClassifier(ITextBuffer buffer)
 {return buffer.Properties.GetOrCreateSingletonProperty(delegate { returnnew BuildLogClassifier(ServiceProvider, FormatMapService, ClassificationRegistry); });
 }
 }

...

 [Export(typeof(EditorFormatDefinition))]
 [ClassificationType(ClassificationTypeNames = Name)]
 [Name(Name)]
 [UserVisible(true)] //this should be visible to the end user
 [Order(Before = Priority.Default)] //set the priority to be after the default classifiersinternalsealedclass BuildStartedFormat : ClassificationFormatDefinition
 {publicconststring Name = "BuildStartedFormat";public BuildStartedFormat()
 {
 DisplayName = "Build Log: Build Started";
 BackgroundColor = Color.FromRgb(200, 250, 200);
 }
 }
...



Does someone have an idea?

It is very easy to reproduce, just create a new EditorClassifier project and change the ContentType Attribute of the provider to "BuildOutput". Set a nice DisplayName to the Format, compile and start the Extension. In VS create or open a new project and start the build. Colorizing works but changing the color settings in the visual studio options for the new format with the nice DisplayName has no effect and will never have.




Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>