• Feeds

    Subscribe in a reader

  • Ads

"Press TAB to implement stubs"

I just discovered the coolest feature in Visual Studio 2003!

Try this: write a stub for a class, like so:

public class Foo
{

}

Go back and declare that class as implementing a pre-defined interface, like IDisposable by changing the first line to be

public class Foo, IDisposable

When you type the last letter of "IDisposable", you get a tool tip that says "Press TAB to implement stubs for IDisposable." When you press tab, the IDE inserts a region in your code containing no-op implementations of the interface you just decided to implement. No more hunting down "Implement Interface" in Class View!

Sweet.