private HighlighterAttributes GetVsHighlighterAttributesNoCache([NotNull] string highlighterAttributeId) { ColorableItems colorableItems = VsColorUtilities.TryGetColorableItemsByName(highlighterAttributeId, _dte); if (colorableItems == null) return HighlighterAttributes.UNDEFINED; Color foregroundColor = ColorTranslator.FromOle((int) colorableItems.Foreground); var attributes = new HighlighterAttributes(foregroundColor); if (colorableItems.Bold) attributes = attributes.Merge(new HighlighterAttributes(FontStyle.Bold)); return attributes; }
private HighlighterAttributes GetVsHighlighterAttributesNoCache([NotNull] string highlighterAttributeId) { ColorableItems colorableItems = VsColorUtilities.TryGetColorableItemsByName(highlighterAttributeId, _dte); if (colorableItems == null) { return(HighlighterAttributes.UNDEFINED); } Color foregroundColor = ColorTranslator.FromOle((int)colorableItems.Foreground); var attributes = new HighlighterAttributes(foregroundColor); if (colorableItems.Bold) { attributes = attributes.Merge(new HighlighterAttributes(FontStyle.Bold)); } return(attributes); }
private static TextStyle ToTextStyle([NotNull] HighlighterAttributes attributes) { FontStyle fontStyle = attributes.FontStyle != HighlighterAttributes.UNDEFINED_FONT_STYLE ? (FontStyle)attributes.FontStyle : FontStyle.Regular; return(new TextStyle(fontStyle, attributes.Color, attributes.BackgroundColor)); }
public FakeHighlighter(string id, Color defaultColour) { AttributeId = id; Attributes = new HighlighterAttributes(defaultColour); }