views:

68

answers:

2

Is there a way in Visual Studio to right click an interface and 'Generate Class from Interface' so I end up with an empty class with all the properties and methods which the interface requires?

Kind of like Extract Interface, but backwards.

+9  A: 

Not quite what you're asking for, but if you create a class, and declare it as implementing your interface, you can right click on the class and select "Implement Interface." This will add the appropriate methods to your class.

Andy White
A: 

I believe the answer before was for C#, but if you are using VB.NET all you need to do is type in the Implements IMyInterface the line below the class declaration and press <Enter>. It automatically generates all of the method and property signatures for you. You can also always go back to the Implements line and press again if any new methods or properties were added to the Interface and they too will be generated for you.

atconway