Reputation: 4363
I have a class which has 10 methods. What i want is to create an interface of that class, i.e the interface will contain only the signature of those 10 methods.
Can it be done easily in .NET using Visual studio?
I am asking this question because I am changing the architecture of my project and for every class present in my project i need an interface.
Upvotes: 4
Views: 300
Reputation: 4469
There are several way to go:
Refactor>Extract Interface
, then choose Members
and provide Interface name
or keep default name if you want leading I
in your class name.class
, press Ctrl+R,I(case insensitive) and then do rest job according to Way 1
Upvotes: 0
Reputation: 5935
Ctrl+C, Ctrl+V. Pretty easy. think about it!
if seriously, Ctrl+R, Ctrl+I - will extract an interface of the class.
Upvotes: 2
Reputation: 4253
If you are using VS 2010 you can do this by just going to the Refractor Menu and click Extract Interface, you can also use the key board short cut Ctrl+R, I
Upvotes: 6
Reputation: 7522
It certainly can. You can use the Extract Interface refactoring to do it for you.
Upvotes: 0
Reputation: 41872
Sounds like a job for ReSharper's Extract Interface refactoring feature.
Upvotes: 0