views:

290

answers:

4

I know that in Eclipse, if your class implements an interface or extends an abstract class, there is a quick way to add the method definitions to your class. Can this be done with VS2005? How?

+2  A: 

This is language specific but

For C#: Right click on the interface, navigate to Implement Inteface and choose the explicit or implict option. The same menu is available for abstract classes (slightly different name)

There is also a smart tag that will show up on a C# interface / abstract base with the same options. The hot key to get this to popup is "CTRL+."

For VB.Net: Simply hit Enter after the interface name and the methods will be auto-populated.

JaredPar
+1  A: 

Hover over the interface name and you'll get a hover-dropdown, which will contain menu options to implicitly or explicitly implement the interface.

Coder 42
+1  A: 

With your insertion point in the name of the interface, hit Alt-Shift-F10, then enter.

Same thing works to automatically add using statements. (ie. Alt-Shift-F10 is the keyboard command to show that menu the little blue underline thing represents)

Edit: I think this is C#-only -- I rarely use VB.Net

Jonathan
+1  A: 

Right-click the interface name IInterface1

public class Class1 : IInterface1

Select "Implement Interface" from the context menu.

Andy McCluggage