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!
Next entry: Navigate from interface to implementation in Visual Studio using CodeRush
Previous Entry: Shortcut to popup intellisense in Visual Studio
Latest entries:
Create absolute URLs using ASP.NET MVC
Comments
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