I'm working on a legacy project, which has been developed over the course of a number of years. The structure is very object-orientated meaning that there are multiple levels of inheritance on the forms. This particular set of forms I am working on has 7-levels from the base form, all the way up to the derived form I need to change (at each level the inherited forms can be inherited further by other forms, but that's outside of the scope of my work thankfully). The inheritance therefore looks something like this:
Base Form
Derived Form 1 : Base Form
Derived Form 2 : Derived Form 1
...
Derived Form 7 : Derived Form 6
The problem I have is that I am doing some UI refactoring, which involves ensuring certain control types are of the correct size/location/padding etc, but the original base form has a lot of controls in, not all of which are used in the derived forms. What seems to be happening is that there will be, for example the following:
MyBasePanel
MyBaseGroupBox
MyBaseTextBox1
The above would be defined in the base form, but as an example Derived Form 5 might add controls to MyBaseGroupBox, which I need to refactor. I am using the Document Outline feature in VS2013 to view the hierarchy, but it is a real pain to spot small changes between forms. My question therefore, is there a way that I can easily see which controls have been defined ONLY on the derived form and don't exist on the base form?
I also have an issue that controls seem to be created in the derived form and then are either hidden or put behind controls derived in a previous form, which makes it even more annoying.
Form6
andForm7
and then just doform7.Controls.Where(c => !form6.Controls.Contains(c));
? – Sayse