Rory Becker - DevExpress CodeRush Blog

New CodeRush Plugin - Declare Extension Method

Another new CodeRush plugin!

This time one to help declare extension methods on existing objects.

Introducing Declare Extension Method

This plugin is really simple.

Consider the following code with a call to an undeclared method MyNewMethod.

DeclareExtensionMethodStart

Place your caret on the call to MyNewMethod and hit your CodeRush Refactor key (Defaults to Ctrl+`)

DeclareExtensionMethodMenu

Choose ‘Declare Extension Method’ from the menu.

DeclareExtensionMethodNewStaticClass

CodeRush generates a new static class in the same namespace as your calling code, containing the stub of your new extension method.

The previous syntax error will have disappeared and all that’s left to do, is for you to fill in the implementation of your new method Smile

Where do I get this Awesome Plugin from ?

Declare Extension Method is available from

GitHub: Here you will find the current (and historical) source of the plugin as well as the latest installable version.

The Visual Studio Gallery: Installing from the Visual Studio Gallery allows VS to locate any updates that are shipped after the initial release.

Published Jun 03 2014, 04:41 PM by
Bookmark and Share

Comments

Donskikh Sergey

Well, I guess it would be nice

June 3, 2014 11:52 AM
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners