C# Features
This section covers transformations that are applied to enhance certain elements with C# features.
1. Expression-bodied members.
1.1. On
Original VB6 Code
Public Property Get Name() As String
Name = m_name
End Property
Public Property Let Name(newName As String)
m_name = newName
End Property
Public Property Get Age() As String
Age = m_age
End Property
Public Property Let Age(newValue As String)
Dim newValue2 As Integer
newValue2 = CInt(newValue)
If newValue2 > 0 And newValue2 < 12 Then
m_age = "Enfant"
ElseIf newValue2 >= 12 And newValue2 < 18 Then
m_age = "Teenager"
ElseIf newValue2 >= 18 And newValue2 < 60 Then
m_age = "Adult"
Else
m_age = "Elder"
End If
End Property
Public Property Get Nationality() As String
Nationality = "Costa Rican"
End PropertyC# Code
1.2. Off
Original VB6 Code
C# Code
2. Generate Auto Implemented Properties
2.1. On
2.2. Off
3. GoTo/GoSub Conversion
3.1. Do not convert Go Sub statements
3.2. Convert only GoSub statements to C# local function
3.3. Convert GoTo and GoSub statements to C# local function
Basic GoSub Statement
Basic GoTo Statement
4. Discards
4.1. On
Original VB6 Code
C# Code
4.2. Off
Original VB6 Code
C# Code
Last updated
Was this helpful?