Fields to Properties (Visual Studio.Net)
Yes, we miss Automatic property generation from the Fields of the classes in the Visual Studio.net IDE.
Following is the sample code of the Macro, I am telling here which I used for myself.
This member variable to Property generation is not generic and is very difficult to be. The idea is that I demonstrate to do it my way and you can customize it for your needs.
Code is in the Visual Basic.Net
--------------------------------------------------
NEED:
Public Class AClass
#Region "Members"
Private strStaffId As String
Private strStaffName As String
#End Region
End Class
-->
Public Class AClass
#Region "Members"
Private strStaffId As String
Public Property StaffId() As String
Get
Return strStaffId
End Get
Set(ByVal Value As String)
strStaffId = Value
End Set
End Property
Private strStaffName As String
Public Property StaffId() As String
Get
Return strStaffId
End Get
Set(ByVal Value As String)...