Rory Becker - DevExpress CodeRush Blog

May 2014 - Posts

  • New CodeRush Plugin – Use Extension Method

    Another plugin requested by our community

    To paraphrase:

    It would be great to have something that could recognise that an extension method was being called in the style of a normal method ie Method(Object, Params) and rewrite the call in the form of an extension method call. ie Object.Method(Params)

    Ok well that seems simple enough:

    Introducing the Use Extension Method Plugin

    So given that we have an extension method like this:

    UseExtensionMethodRequest1

    … and some calling code looks like this :

    UseExtensionMethodRequest2

    The Use Extension Method plugin will add an option to your CodeRush SmartTag menu which will convert the method call in question to the following.

    UseExtensionMethodRequest3

    So where can I get this plugin?

    As usual this plugin is available in 2 locations

    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.

  • New CodeRush Plugin – Convert String to AppSetting

    A customer recently tweeted:

    Any chance of a CodeRush plugin to convert a literal to a config (app.config) setting? pretty please

    Well when the request is so polite, it’s hard to say no Smile

    The Convert String to AppSetting plugin adds a new Refactoring to your standard arsenal.

    Simply…

    • Place your caret on the string in question.

      ConvertStringToAppSettingBefore
    • Hit your CodeRush \ Refactor key ( Defaults to Ctrl+` )
    • Choose Convert String to AppSetting from the list of refactorings.

      ConvertStringToAppSettingMenu

    CodeRush will…

    • Create a new App.config file if one doesn’t already exist.
    • Add a new setting deriving it’s name from the text of your initial string.

      ConvertStringToAppSettingAppConfig
    • Replace the original string with a call to ConfigurationManager.AppSettings

      ConvertStringToAppSettingAfter
    • Link the key-text of your new setting with that of the call, so that you can easily rename them as one.

    So where can I get this wonderful plugin?

    This plugin is available in 2 locations

    GitHub: From here you can get 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 provides the added bonus of VS being on the lookout for any updates that are shipped on your behalf.

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