I have a WinForm
that I have used to build and test an email newsletter. This form contains a number of methods and events.
I am now adding a new feature to my program to allow split testing (A/X Test) and therefore creating up to 4 different newsletters for a campaign.
Therefore I'd like to extend my form to accommodate both normal newsletters and A/X newsletters. I'm going to add two different modes to my form. Something like:
private enum CampaignMode { Normal, AxTest };
They will be very similar in appearance, except a number of controls' visibility will change.
Apart from that, almost all methods and events will have two separate ways of handling.
What design pattern should I use so that I don't have to create a new separate form?
For simplicity, let's say my form has the following methods:
- Constructor: probably receiving the
EditMode
as a parameter - Load
- Create: Button click event
- SetControlViews: Based on
EditMode
set the visibility of controls - MethodA: Specific to
Normal
mode - MethodB: Specific to
AxTest
mode
Aucun commentaire:
Enregistrer un commentaire