我不明白 Visual Studio 手表中有一個范圍圖標,它是有時出現(xiàn)在屬性或字段圖標上的“禁止”標志。CF附截圖。我確實檢查了 VS2015 圖標的文檔,但絕對沒有看到這個“不行”標志:https ://msdn.microsoft.com/en-us/library/y47ychfe.aspx這是什么意思?編輯:我的財產(chǎn)被宣布為公開:public virtual DateTime? MyProp1 { get; set; }由于 virtual 關鍵字,該標志不存在,因為我在同一個類中還有其他自動屬性也聲明為 public virtual 并且間諜沒有費心添加這個“無路標”。例如:public virtual MyType MyProp2{ get; set; }
1 回答

UYOU
TA貢獻1878條經(jīng)驗 獲得超4個贊
我知道了!這顯然只發(fā)生在屬性可以為空時
public DateTime? MyProp1 { get; set; } //there will be a "no way icon" when the property is instanciated
public DateTime MyProp2 { get; set; } //no "no way icon"
仍然不知道為什么這個圖標沒有列在原始帖子的 MS 文檔鏈接中......
- 1 回答
- 0 關注
- 243 瀏覽
添加回答
舉報
0/150
提交
取消