While working with Control Adapters in either ASP.NET or SharePoint 2007 you will quite often want to intercept the output of the parent control and modify it before rendering. As retrieving the output is the same for each and every control I have created the following code snippet:
Recently I've been looking at various extensibility possibilities of Visual Studio 2008. After having successfully done a proof of concept I have thought, that ideally, I would never want to have to leave my development IDE while working on a SharePoint solution. Preferably I would like to have all the tools I need and all the shortcuts inside Visual Studio and run them with one single click. Wouldn't the life be great?
I create very often little projects to try things out: either based on the Console Application or the Class Library template. As it's SharePoint development we're speaking of the first thing you need to do is to add references to the Microsoft.SharePoint assembly. Depending on what you're doing you might need to add the references to System.Web and Microsoft.SharePoint.Publishing as well or maybe even more. You can do it just the regular way by clicking with right button on the project References and adding new reference but there is a faster way.
Extension Methods are a new feature of Visual Studio 2008. They basically allow you to add new methods to already existing classes. You could for example introduce a new method: String.IsValidEmailAddress() which would validate whether the given string is a valid e-mail address. Scott Guthrie has written some more information about the Extension Methods in Visual Studio 2008.