設置只讀屬性手短,我經常反覆做這個在vb.net是否有在vb.net
Private _nerfed As Boolean
Public ReadOnly Property nerfed As Boolean
Get
Return _nerfed
End Get
End Property
我不知道是否有一個簡短的手嗎?
我知道
Private _nerfed As Boolean
Public Property nerfed As Boolean
Get
Return _nerfed
End Get
Set (nerfed)
_nerfed =nerfed
End Get
End Property
可以簡單地
Public Property nerfed As Boolean
那麼,關於只讀變異可以縮短?
其他答案也不錯。我只是選擇這個提到汽車實施 –