更新:2007 年 11 月
错误消息
属性访问器已经定义
当声明属性时,还必须声明它的访问器方法。不过,一个属性不能有多个 get 访问器方法或多个 set 访问器方法。
示例
下面的示例生成 CS1007:
// CS1007.cs
public class clx
{
public int MyProperty
{
get
{
return 0;
}
get // CS1007, this is the second get method
{
return 0;
}
}
public static void Main() {}
}