I need to hide few methods inside a class based on the parameter that is passed to the constructor in c#. How would I do this? Thanks in advance!
More Info: I was part of this GUI development where they had a API with access to registers in a hardware. Now they are releasing a newer hardware so I need to support both old and new one which has a newer API(Mostly duplicate of old one with some old removed and some new registers added).
Moreover, I need to keep this only one class called "API" as we used it in many places. So the idea of using a newer API with a different name was ruled out.
Now finally, I got this idea of including the newer one into old one with just conditionally hiding the registry access methods.
You can't toggle the visibility of members..... the best bet is to have different interfaces that hide the members.
So either use Worker through the IName or the INumber interface and it will hide the other members on the class....