红吧天下-睿玲 2022-09-26 16:58 采纳率: 33.3%
浏览 29
已结题

=> 这个符号在vs能用吗?

vs2008

img

public short NewGroupLevel => this.m_newGroupLevel;
public string NewGroupName => this.m_newGroupName;

public string NewGroupPath => SharedUtils.ConvertIntArrayToString(this.m_newGroupPath);

public string NewGroupNamePath => this.m_newGroupNamePath;

public short CurrentGroupLevel => this.m_curGroupLevel;

public string CurrentGroupName => this.m_curGroupName;

public string CurrentGroupPath => SharedUtils.ConvertIntArrayToString(this.m_curGroupPath);

public string CurrentGroupNamePath => this.m_curGroupNamePath;

public bool IsDrillDown() => (int) this.NewGroupLevel >= (int) this.CurrentGroupLevel;
错误 2 应为 { 或 ;
要怎么改,vs2008不接受这个格式
  • 写回答

2条回答 默认 最新

  • wanghui0380 2022-09-26 17:42
    关注

    C# 6.0 语法糖:只读自动属性,vs2015以上支持(语言框架版本应该是4.52以上)
    如果你是vs2008,你知道他是只读属性,那么可以手动修改成下面这种传统只读属性的形式

    xxxx  {get { return 1;}}
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 10月5日
  • 已采纳回答 9月27日
  • 创建了问题 9月26日