467,878 Members | 1,259 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,878 developers. It's quick & easy.

shortcut key to implement interface

If I'm in a class that inherits an interface, is there a shortcut key that
will write the implementation of the interface into the class? I remember
seeing something like this in vb.net.

Thanks.

--
mo*******@nospam.nospam
Mar 1 '06 #1
  • viewed: 13036
Share:
7 Replies
"moondaddy" <mo*******@nospam.nospam> a écrit dans le message de news:
uZ**************@tk2msftngp13.phx.gbl...

| If I'm in a class that inherits an interface, is there a shortcut key that
| will write the implementation of the interface into the class? I remember
| seeing something like this in vb.net.

Right-click on the interface name in the class declaration, it will allow
you to implement the interface either implicitly or explicitly.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Mar 1 '06 #2
OK I found the text below in MSDN, however, this is only when you are first
declaring the class. Is there a shortcut key you can use after the fact?
IntelliSense provides an option to help you implement an interface (C#
Reference) while working in the Code Editor.

Remarks

Normally, to implement an interface properly you must create a method
declaration for every member of the interface in your class. Using
IntelliSense, after you type the name of an interface in a class
declaration, a smart tag is displayed.

The smart tag gives you the option to implement the interface automatically,
using explicit or implicit naming. Under explicit naming, the method
declarations carry the name of the interface; under implicit naming, the
method declarations do not indicate the interface to which they belong. An
explicitly named interface method can only be accessed through an interface
instance, and not through a class instance. For more information, see
Explicit Interface Implementation (C# Programming Guide).

Implement Interface will generate the minimum number of method stubs that is
required to satisfy the interface. If a base class implements parts of the
interface, then those stubs are not regenerated.

The Implement Interface option is available automatically when you add an
interface declaration to a class. For more information, see How to:
Implement Interface
--
mo*******@nospam.nospam
"moondaddy" <mo*******@nospam.nospam> wrote in message
news:uZ**************@tk2msftngp13.phx.gbl...
If I'm in a class that inherits an interface, is there a shortcut key that
will write the implementation of the interface into the class? I remember
seeing something like this in vb.net.

Thanks.

--
mo*******@nospam.nospam



Mar 1 '06 #3
Hi,

Thanks for posting!

For the current issue, as far as I know, there is no shortcut key to
implement an interface. But I suggest you use the keyboard function in
Visual Studio 2005.

This means you choose the "Tools" - "Options" and then extend the
"Environment"-"Keyboard" node. Under the "Use new shortcut in" text box,
please choose the "Text Editor". Then, you can find the
"ClassDiagram.ImplementInterfaceStubsExplicitl y" and
"ClassDiagram.ImplementInterfaceStubsImplicitl y" and just assign them a
shortcut key whatever you want.

I hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Mar 2 '06 #4
sounds good thanks.

--
mo*******@nospam.nospam
""Yuan Ren[MSFT]"" <v-****@online.microsoft.com> wrote in message
news:Hy**************@TK2MSFTNGXA03.phx.gbl...
Hi,

Thanks for posting!

For the current issue, as far as I know, there is no shortcut key to
implement an interface. But I suggest you use the keyboard function in
Visual Studio 2005.

This means you choose the "Tools" - "Options" and then extend the
"Environment"-"Keyboard" node. Under the "Use new shortcut in" text box,
please choose the "Text Editor". Then, you can find the
"ClassDiagram.ImplementInterfaceStubsExplicitl y" and
"ClassDiagram.ImplementInterfaceStubsImplicitl y" and just assign them a
shortcut key whatever you want.

I hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no
rights.
================================================== ====

Mar 2 '06 #5
Hi,

You are welcome:)

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no
rights.
================================================== ====

Mar 2 '06 #6

"moondaddy" <mo*******@nospam.nospam> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
OK I found the text below in MSDN, however, this is only when you are
first declaring the class. Is there a shortcut key you can use after the
fact?


In VS2005 it works anytime.
Just click on the interface name and a little "thingy" appears under the
"I".
Hover over that and a menu "thingy" appears.

If you have 2003 - tough - it's a pain isn't it.
Mar 2 '06 #7

"moondaddy" <mo*******@nospam.nospam> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
OK I found the text below in MSDN, however, this is only when you are
first declaring the class. Is there a shortcut key you can use after the
fact?


No it is anytime - just click on the interface name - UNLESS you are using
VS2003
Mar 4 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Salad | last post: by
8 posts views Thread by Henrik Dahl | last post: by
1 post views Thread by Steve M | last post: by
3 posts views Thread by thi | last post: by
52 posts views Thread by Ben Voigt [C++ MVP] | last post: by
5 posts views Thread by Tony Johansson | last post: by
reply views Thread by jack112 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.