【发布时间】:2011-01-29 12:19:12
【问题描述】:
我有课:
class MyPic
{
private Bitmap bmp=null;
public MyPic(Bitmap b)
{
bmp=b;
}
public Bitmap Bmp
{
get { return bmp; }
}
}
我创建了 Bmp 只读属性,但用户仍然可以使用SetPixel 方法对其进行修改。我怎样才能防止这种情况发生?
【问题讨论】: