I was wondering if it was impossible to set up an accessor to allow you to access the accessor's variable.. Example of an error:
public void Main()
{
Object.name = "test"; //Can't access the object's subproperties
}
Objec ob = new Objec();
public Objec Object
{
get { return ob; }
set { ob = value; }
}
class Objec
{
string name;
string value;
}
Is there anyway to do the above (other than making accessors for every value)?
Thanks,
Max
EDIT: Here is a better example
public void Main()
{
//Now I can't change the X or Y properties, this will display an error
ThePoint.X = 10;
//To change the x value, I need to do the following:
ThePoint = new Point(10,0);
}
private Point Poi = new Point();
public Point ThePoint
{
get { return Poi; }
set { Poi = value; }
}
Is there a way to make 'ThePoint.X' work (without just publicly displaying 'Poi')?