One feature of CodeRush from DevExpress which I use a lot when navigating code is the ability to navigate to a function/method/property implementation from a variable that is of an interface type. I do a lot interface programming (OK OK I get a bit interface happy) and this navigation feature rocks.
The default shortcut keys to bring up the Navigate/Jump To menu is Ctrl + Alt + N. I prefer to bind the Navigate command to Ctrl + E, as it is a bit quicker to type when your fingers are in home position on the keyboard. I show how to update the binding in the screen cast embedded with this blog post.
With the cursor on a function/property of a variable of some interface type, bring up the Jump To menu.
If you pick Implementations from the popup menu, you’ll be taken to the class implementation of the interface function/property. If multiple implementations exist, then a popup menu displaying the various choices will be displayed.
I created a screen cast to show this feature in action:
I’d suggest experimenting with the other Jump To options as well as they come in handy when navigating code.
I hope this helps!
A CodeRush feature that comes in very handy from time to time is the ability to easily extract and implement interfaces in Visual Studio.
This tip involves using the Refactor command included with CodeRush/Refactor Pro. The default shortcut key is Ctrl + ` . Personally I prefer to map the Refactor command to Ctrl + R for a more convenient key stroke. I show how to do the mapping in the screen cast embedded later in this blog post.
You can easily extract interfaces from an existing class. With the cursor on a class, bring up the Refactor menu and select Extract Interface.
This will create an interface that contains the public properties and methods of the class. You can then move the interface to it’s own file by using the Refactor menu once again and select Move Type to File.
You can very quickly create and interface implementation. With the cursor on an interface, bring up the Refactor menu and select Create Implementer. You can choose to create an implicit or explicit implementation.
You can quickly move the implementation to a separate file the same way as shown above for extracting an interface.
I created a screen cast to show this in action:
CodeRush/Refactor Pro is a rock’in Visual Studio add-on from DevExpress.
I hope this helps!
Visual Studio tip: if the cursor is located after a variable followed by a dot without intellisense showing, press Ctrl + Space Bar to bring up intellisense. One common use of this shortcut is if the wrong property or function is chosen you can quickly select the property or function, delete the selection, and press Ctrl + Space Bar to popup intellisense to pick the correct one.
I created a short demonstration to show the shortcut in action:
I hope this helps!
My Links
Tags
Follow me
About
Powered by FoxBlog
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2011, Nathan Fox