Exposing Add-in Settings

The final step is to make the add-in’s language choice a configurable option. Users should be able to indicate whether they want the add-in to emit C# or Visual Basic code. To do this, you need to have a user interface in the form of an Options page (that displays in the Options dialog box), and you need a place to persist the option selections.

Creating the Option Page UI

Add-ins can reference an Options page that appears in the Tools Options dialog box. Again, as you did with the custom tool window, you build a user control to implement the logic and the user interface for the Options page.

You start by adding a new user control to the existing add-in project. For this example, call this class PaletteControlOptionPage. ...

Get Microsoft® Visual Studio® 2010 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.