Ticket T322082
Visible to All Users

Project Converter - Provide the capability to upgrade versions in class attributes

created 9 years ago

In my project I have several classes that derive from your classes. E.g.:

C#
[Designer("DevExpress.XtraBars.Design.BarManagerDesigner, DevExpress.XtraBars.v15.1.Design", typeof(IDesigner))] [DXToolboxItem(true)] [LicenseProvider(typeof(DXWinLicenseProvider))] [ProvideProperty("PopupContextMenu", typeof(Control))] public class MyBarManager : BarManager { public MyBarManager(); public MyBarManager(IContainer container); protected override BarManagerPaintStyle PaintStyle { get; } protected override BarManagerHelpers CreateHelpers(); protected override BarSelectionInfo CreateSelectionInfo(); protected override void OnLoaded(); }

As you can see in the very first line, I use the Designer attribute to specify the WinForms designer.

Now when (e.g.) upgrading from DX 15.1 .8 to DX 15.2.3, the following happens:

- The DX project upgrade converter does not convert the above string.

This results in error messages like:

C#
The variable 'barManager' is either undeclared or was never assigned.

when opening the Windows Forms designer in Visual Studio.

My resolution is to manually change the strings.

My suggestion:

Please consider enhancing your awesome converter tool to also convert the strings inside the Designer attribute.

Answers approved by DevExpress Support

created 9 years ago (modified 9 years ago)

Hi Uwe,

The Project Converter tool is not designed to modify customer code. In very rare cases projects' aliases for some namespaces can be modified to resolve issues with upgrading. But the main idea is not to touch what was written by a developer.

As for the issue, I see that the same attributes are applied to a custom BarManager class as applied to our BarManager. It is not clear to me why you need to duplicate them in your custom class, especially when the attributes are not modified at all. I am sure that removing these attributes will not cause any issues to your custom BarManager class.

If, for some reasons, you still need them, replace the DevExpress.XtraBars.v15.1.Design string with the AssemblyInfo.SRAssemblyBarsDesign property, which contains actual information about the XtraBars designer class for a current version of assemblies.

Let me know if you have additional questions.

    Comments (2)

      Thanks, Alisher.
      I've just checked the documentation of the Designer attribute at https://technet.microsoft.com/en-us/library/system.componentmodel.designerattribute.aspx and saw that the Inherited property is set to true.
      So I'll second your suggestion to simply remove it.
      Sorry for not doing my own research!

      Alisher (DevExpress Support) 9 years ago

        No worries, Uwe. You are always welcome. :)

        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.