Skip to content
This repository has been archived by the owner. It is now read-only.

Commit a92ad23

Browse files
committed
Added some examples to VB demo project.
1 parent 2409fdf commit a92ad23

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

Demonstration.VB/Demonstration.VB.vbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<DependentUpon>Settings.settings</DependentUpon>
8686
<DesignTimeSharedInput>True</DesignTimeSharedInput>
8787
</Compile>
88+
<Compile Include="SomeClass.vb" />
8889
</ItemGroup>
8990
<ItemGroup>
9091
<EmbeddedResource Include="My Project\Resources.resx">

Demonstration.VB/MainModule.vb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Sub Main()
44

5+
Dim x As Integer = 0
6+
' Refactoring to convert "Do ... Loop until" to "Do Until ... Loop" and vice versa
7+
Do
8+
x += 1
9+
Loop Until x = 5
10+
511
End Sub
612

713
End Module

Demonstration.VB/SomeClass.vb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Public Class SomeClass
2+
3+
Public Sub New(Name As String)
4+
If Name Is Nothing Then
5+
' Analyzer + CodeFix to replace "Name" by NameOf(Name)
6+
Throw New ArgumentNullException("Name")
7+
End If
8+
End Sub
9+
10+
Dim _count As Integer
11+
' "Add another accessor" refactoring
12+
Public ReadOnly Property Count As Integer
13+
Get
14+
Return _count
15+
End Get
16+
End Property
17+
18+
Dim _name As String
19+
' "Create changed event" refactoring
20+
Public Property Name As String
21+
Get
22+
Return _name
23+
End Get
24+
Set(value As String)
25+
_name = value
26+
End Set
27+
End Property
28+
29+
End Class

0 commit comments

Comments
 (0)