Is there an access modifier, that allows inherited classes to modify the parent class' members in c#?
<p>Hello fellow strangers,
is there a way to limit the access to the members of these classes as outlined in the comments;</p>

<pre><code>class a
{
    int p  //should be accessable by b,c, but not by x
}

class b:a
{
    int q //should be accessable by c, if it has to by a, but not by x
}

class c:b
{
    public int r //obviously accessable by anyone
}

class x
{
    c testfunction()
    {
        c foo=new c();
        foo.r=20;
        return foo;
    }
}
</code></pre>

<p>It is a little bit more complicated than the sample code here but I think I get my problem across.</p>
