I have taken over a project, that have been coded by someone else. There are weird stuff in it like this: An interface declaring a custom event named Load ( event EventHandler Load; ) Since the Form class has its own Load event, what is supposed to happen when this interface is implemented? Is it some form of overriding the default event, if so what purpose does it serve to? thx in advance
A:
Well, the interface declaration isn't actually writing any code, it's just forcing an implementation. So given that the form already implements it, if the interface is applied to the form, it will just "implement" the interface, by virtue of it already being there! So it has no negative affect.
What purpose does it server? Perhaps the person provides that interface to other people, who only need to know that the underlying object is of type IWhateverItIs
, and can attach to the Load
event appropriately.
Noon Silk
2009-08-26 07:13:59