samedi 29 juillet 2017

How to force inheriting class's method implementation to call base method before invoke own implantation?

I wrote some not sealed class that contain 3 virtual public method and one private method.

And i make this class public that all my develop group member could use this class ( include inherits and override the virtual public methods ) .

One of the private method name is 'PrivateMethod77()'.

Each time the public method 'PublicMethod77()' is call => the 'PrivateMethod77' is call in the first line of the method implementation ( after this line there are more implication logic ).

I want to keep this logic and 'force' the inherits and override of the method PublicMethod77 to call the PrivateMethod77 method as the first line of the PublicMethod77

Is there a way to do it ?

Aucun commentaire:

Enregistrer un commentaire