haacked / Encourage

A bit of encouragment added to Visual Studio
75 stars 32 forks source link

Demo signature help #2

Closed haacked closed 10 years ago

haacked commented 10 years ago

Fixes #1

Thanks @jaredpar! You mentioned I should consider a Text Adornment.

One nice thing about the Signature Help is that it responds to theme changes. How would I do that with a Text Adornment?

77

76

So far, this works very nicely as-is!

jaredpar commented 10 years ago

Didn't think about the theming aspect there.

I've only done a limited amount of theming in my applications. Mostly around changing colors or fonts. Fonts are pretty easily done by using the VsBrushes class

http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.vsbrushes(v=vs.110).aspx

These can be used in XAML as a dynamic resource (see the bottom of that page for an example).

For items like Fonts the best way to go is to use the IEditorFormatMap for the correct context (there is one associated with ITextView instances). It's basically a giant property bag for fonts, colors, brushes, etc ... It also has change events to hook into

http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.text.classification.ieditorformatmap.aspx