Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day!

Could you guide me where should I start searches on such issue. We have a huge amount of WinForms code using some Custom DropDown control(let's say UltraDropDown). Mostly its in InitializeComponent method. I need to change type of that control to let's say DevDropDown. That two types are both DropDown controls in its base, but have absolutely different properties, so just deleting old UltraDropDown and renaming DevDropDown to UltraDropDown won't help, cause i don't want to wrap all that useless properties to my new control. What I want is some codegeneration tool that would search old UltraDropDown and clear its code in InitializeComponent method except Location and Sizes, and paste new DevDropDown code. May be there are some patterns for creating such tool?
Posted

1 solution

No tool will help you here other than a find/replace with a lot of time changing property names by hand.

One possibility is to create a wrapper for DevDropDown to make it look like UltraDropDown ( properties you have used) and plugin that into your source [this may not be possible if the control is sealed etc.]:
C#
public class myDropDown : DevDropDown
{
   public string PropertyOfUltraDropDownWhichIsUsed {get;set;} 
} 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900