IDE - support for use of interfaces

F

Frank Esser

Hi!

When I want to implement a new class on base of an existing interface I
always have to switch between window of new class and the interface
definition.

Is there an easier way? Any support by IDE?
E.g. a command to add all required methods/properties to the class as soon
as there is a reference to an interface?

Thanks!
 
H

Hans Kesting

Frank said:
Hi!

When I want to implement a new class on base of an existing interface I
always have to switch between window of new class and the interface
definition.

Is there an easier way? Any support by IDE?
E.g. a command to add all required methods/properties to the class as soon
as there is a reference to an interface?

Thanks!

That is standard functionality in VS. As soon as I finish typing
the ": IInterface", VS shows a message "press TAB to add methods".

But: that interface should be known to your new class. If your interface
is in a different project, you should have built that and referenced
in the project of the new class. Also you need either a "using"
clause or use a namespace path, so VS has a chance to know what you mean.

If you *change* the interface, you have to change the class by hand
(AFAIK).
 
M

Matt Berther

Hello Frank,

Hans's method works. I also wanted to let you know that JetBrains also makes
a tool called ReSharper [1], which provides a lot of IDE usability enhancements
such as easier interface implementations and overriding.

[1] http://www.jetbrains.com/resharper/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top