C
Curious
I have a class PrivateConnection which is a derived class from the
CoreConnection class.
class CoreConnection
{
private bool mCanWrite = true;
protected bool CanWrite
{
get { return mCanWrite; }
set { mCanWrite = value; }
}
}
class PrivateConnection : CoreConnection
{
public void ChangeParentCanWrite()
{
parent.CanWrite = false; // this will not work!
}
}
Now I want to set the "CanWrite" property in its parent object from
the method in "PrivateConnection". What's the snytax for this? Thanks!
CoreConnection class.
class CoreConnection
{
private bool mCanWrite = true;
protected bool CanWrite
{
get { return mCanWrite; }
set { mCanWrite = value; }
}
}
class PrivateConnection : CoreConnection
{
public void ChangeParentCanWrite()
{
parent.CanWrite = false; // this will not work!
}
}
Now I want to set the "CanWrite" property in its parent object from
the method in "PrivateConnection". What's the snytax for this? Thanks!