you?
No, in general I would not. But sometimes, I need to hide all methods of the
base class, and this is not possible in C#. I am using C++ for too long time,
perhaps. Consider the following scenario:
I have a class A:
class A
{
int Get(...);
int Set(...);
};
which does whatever it does and servers as a base class for both class B,
which is used internally and class C, which is exposed to be used by 3rd
party. Let's assume that A.Get and A.Set methods are not "safe", and can be
use only by us (in derived class B), but we can provide "safe" limited
functionality to 3rd party (class C). This can be easily done in C++ as:
class C : protected A
{
int GetOnlySomething() { return Get("Something"); }
int SetOnlySomething() { return Set("Something"); }
};
while having
class B : public A
{
...
};
A.Get and A.Set are not available for public use. (A methods could be
protected, but let's say we need them public due to way they are used by us
internally). The point is, that if anyone adds any method to class A, it is
not automatically available in class C, so C "safety" remains.
In C#, you have to implement a new (or override existing virtual) method
with "protected" access modifier, and it will not be automatically done if a
public method is added to class A, which makes class C not to be "safe"
anymore.
You may find this example complicated, but it represents real situation
(designed before I've joined the company

. I also believe, that the whole
thing could be solved by changing/improving C++ OO design - but using
"protected" base class access modifier in C# would allow me to port the whole
bunch of C++ classes very easily...
Regards,