I have the following forms in my winforms framework
- FormBase (inherited from Form)
- FormBaseList (inherited from FormBase)
- FormBaseDetail (inherited from FormBase)
Now every form in the application inherits from on one of the 3 above.
For example FormCustomerList
will be inherited from FormBaseList
Now in FormBaseList
the event FormBaseList_Shown
is present (by doubleclicking on it in the properties window in VS)
What I would like to know in the code from FormBaseList_Show
is if there is an event FormCustomerList_Show
present (again by doubleclick on it in the properties window).
Is that even possible ?
So why do I want this ?
Because some changes in the framework require the forms to not use the Shown
event anymore but a custom event.
I would like to catch and show a warning to the developer if he adds a Show
event to a form, and if it is really needed he can set a property that will hide this warning.
This warning does not needs to be shown at designtime, at runtime would be enough. But if its possible at designtime that would be a bonus.
So can this be done and is there maybe a better way to do this ?
I hope this explanation is clear
EDIT
The idea is that when a developer makes use of a Show event he must get a warning (either at designtime or runtime). If he feels that he really needs the Show method he should be able to set the warning off for this particular form