我不知道描述我的问题的正确技术术语,所以我举个例子:
private Point _PrivateVect = new Point();
public Point Publicvect
{
get
{
return _PrivateVect;
}
set
{
_PrivateVect = value;
}
}
问题是如果我想访问Publicvect.X
我会得到错误Cannot modify the return value of 'Publicvect' because it is not a variable
。有没有解决的办法?还是我只需要Publicvect = new Point(NewX, Publicvect.Y);
永远做?