Exposing some protected properly

  • Thread starter Thread starter David Dvali
  • Start date Start date
D

David Dvali

I have some basic questions please.
What is the best way of exposing some protected properly of base class as
public properly?
 
I guess my first question would be, why?

Isn't it protected for a reason? Why would you want to make it public?

If you really want it public, just make a property:


class A
{
protected string Text
{
get
{
return "A's Protected String";
}
}
}

class B : A
{
public string PublicText
{
get
{
return base.Text;
}
}
}
 
Back
Top