문제

What is the shortcut for auto-implementing a property in vb.net? I want get/set and associated field, like with "propfull" in C#.

I'm using VS12 with ReSharper 7.1.3

도움이 되었습니까?

해결책

you can declare property just like this without get or set

Property Prop2 As String = "Empty"

this is equivalent to

Private _Prop2 As String = "Empty" 
Property Prop2 As String 
    Get 
        Return _Prop2
    End Get 
    Set(ByVal value As String)
        _Prop2 = value
    End Set 
End Property

here are the details http://msdn.microsoft.com/en-us/library/dd293589.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top