Ticket T294233
Visible to All Users

Smart Constructor - Add an ability to initialize properties

created 9 years ago

[DevExpress Support Team: CLONED FROM T293949: Constructor creation (positionning and init properties)]
Hello,

I have a class with some properties. When you use "cc" to create the constructor:

- the "cc" not propose the properties to add as argument in the constructor and there are no set of the properties in the constructor.

Check the video,

Regards,

Show previous comments (7)
DR DR
Daniel Rosenberg 9 years ago

    I see. That's a valid point. I didn't know CRC was in maintenance-only mode.

    Mark Miller (DevExpress) 9 years ago

      CRC is not yet in maintenance-only mode, and it may get new features as we move forward (for example, CRC 15.2 gets two big features in this release, Code Coverage and Paste as Xaml/SVG), but it is highly unlikely that CRC will ever get support for new *language* features such as those in C# 6.0. In addition to the option Christian mentions about switching to CRR to get C# 6.0 support, there is also a possibility of installing both CRC and CRR on the same machine and using both in the same instance of Visual Studio - which may be worth the hassle of configuration - turning off unwanted features in CRC or CRR, depending on what you need. We expect to achieve feature parity in CRR (with the current feature set in CRC) in the 16.1 timeframe.

      DR DR
      Daniel Rosenberg 9 years ago

        Thanks for the clarification Mark. Personally, since I went CRR I've never looked back - keep it up!

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        Hi Christian,
        We've added the capability to initialize properties in SmartConstructor.
        You can download a daily build and try this functionality.

          Show previous comments (5)
          DevExpress Support Team 9 years ago

            Hi Daniel,

            It completely depends on the complexity of the improvements you are asking for.
            If we can make changes quickly, we prefer delivering them to a customer as fast as possible.
            But there can be improvements which take a significant amount of time and a lot of resources for their implementation. In this case, we cannot give the customer a quick decision, but try to keep him/her updated when the ticket state changes.

            DR DR
            Daniel Rosenberg 9 years ago

              Hi Eugene,
              I found one more issue with this feature that you might want to address.
              If there is a property on the type, whose lower-case representation conflicts with a language keyword, the refactoring produces syntactically incorrect code.
              For example, if you have a property "Default" on your class, and use the "cc" template, the resulting constructor parameter is named "default" which is a reserved keyword. This results in an immediate compiler error.
              This refactoring should prefix such parameter names with @, i.e. "@default".

              DevExpress Support Team 9 years ago

                Hi Daniel,

                Thank you for pointing this out to us.
                I think it will be more convenient to discuss this issue in a separate ticket. I have created it on your behalf: SmartConstructor should not get the reserved keywords as a parameter name.
                We'll make necessary changes and let you know of our results.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.