Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autocreate stub properties for interfaces in C#?

I've switch from VB.NET to C# several months ago, while there are a lot of features I really like in C#, believe it or not, there are some features that I really miss from VB.NET.

One of those features is whenever I implemented an interface in VB.NET the stub properties and methods were automatically added for me.

Is there any way to do this in C#?

like image 934
mattruma Avatar asked Nov 22 '08 22:11

mattruma


2 Answers

Right click on the name of the interface in the class that implements it, click 'Implement Interface' then click on either of the following two:

Implement Interface: Implements stub props and methods for you.

Implement Interface Explicitly: Implements stub props and methods for you, but also explicitly names the interface the stub is for.

like image 197
David Avatar answered Oct 10 '22 20:10

David


Also you can use the shortkey CTRL + ALT + F10 and then hit ENTER. Or you use CTRL + > :-)

like image 30
Mariusz Avatar answered Oct 10 '22 21:10

Mariusz