ASP.NET Hosting

Visual Studio Tips

While showing-off the previous tip to a mate I was eagerly pointed in the direction of this link:

http://www.sellsbrothers.com/spout/default.aspx?content=archive.htm#vs.netfunfacts

Chris Sells does it yet again!

[Darren Neimke]

Two I like and didn't know about:

  • Let the IDE implement the stubs of an interface function in a class (not a struct):

    1. Type the name of the interface after the name of the class, e.g. "class Foo : IDisposable".
    2. In the Class View (Ctrl-Shift-C), navigate to the class, e.g. Foo, and choose the interface you'd like stubs for under Bases and Interfaces for that class.
    3. In the context menu (Shift-F10), choose Add->Implement Interface.
    4. Bask in the glory of Don Box (who showed me this trick).
  • Let the IDE implement the stub of an virtual function override:

    1. In the Class View (Ctrl-Shift-C), navigate to the class, e.g. Foo, and choose the method on the base class you'd like to override under Bases and Interfaces for that class.
    2. In the context menu (Shift-F10), choose Add->Override.
    3. Bask in the glory of me, who found this all by myself. I found this digging through the .VSZ files on my system. It looks like you can add your own context items to the menus, which sounds like fun...

I recommend to use this with "Synchronize Class View" from the editor context menu.

Update: The two tips above seem to work only for C#.

3 Comments

Comments have been disabled for this content.