Manipulating Code in Windows
Thus far, in working with code in the IDE’s Text Editor windows, I’ve made very few references to the extensibility object of Visual Studio.NET. I’ve done this for two reasons. First, I wanted to get quickly and simply into building some usable functionality in an add-in. Second, I wanted to demonstrate the use of some common methods that you can reuse most of the time for retrieving code from a code window, performing some operation on the code, and subsequently putting it back into the code window without having to constantly be concerned with the complex syntax of the extensibility object. I suspect that the library routines I’ve provided for retrieval and replacement of code in a window will work for you 90 percent of the time you want to work on code.
KeywordsVisual Studio Active Document Output Window Tree View Code Snippet
Unable to display preview. Download preview PDF.