Skip to content

Commit 3ef9fab

Browse files
authored
Update source2.vb (#48074)
* Update source2.vb * Add vbproj file * Update source4.vb to ensure type names uniqueness
1 parent e4021bb commit 3ef9fab

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>

samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.ThreadStart2/VB/source2.vb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Public class Simple
4242
+ "starting the new InstanceCaller thread.")
4343

4444
' Create the thread object, passing in the
45-
' serverObject.SharedMethod method using a
45+
' ServerClass.SharedMethod method using a
4646
' ThreadStart delegate.
4747
Dim SharedCaller As New Thread( _
4848
New ThreadStart(AddressOf ServerClass.SharedMethod))
@@ -56,9 +56,9 @@ Public class Simple
5656
End Class
5757
' The example displays output like the following:
5858
' The Main() thread calls this after starting the new InstanceCaller thread.
59-
' The Main() thread calls this after starting the new StaticCaller thread.
60-
' ServerClass.StaticMethod is running on another thread.
59+
' The Main() thread calls this after starting the new SharedCaller thread.
60+
' ServerClass.SharedMethod is running on another thread.
6161
' ServerClass.InstanceMethod is running on another thread.
6262
' The instance method called by the worker thread has ended.
63-
' The static method called by the worker thread has ended.
63+
' The shared method called by the worker thread has ended.
6464
'</snippet2>

samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.ThreadStart2/VB/source4.vb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'<snippet4>
22
Imports System.Threading
33

4-
' The ThreadWithState class contains the information needed for
4+
' The ThreadWithState2 class contains the information needed for
55
' a task, the method that executes the task, and a delegate
66
' to call when the task is complete.
7-
Public Class ThreadWithState
7+
Public Class ThreadWithState2
88
' State information used in the task.
99
Private boilerplate As String
1010
Private numberValue As Integer
@@ -34,13 +34,12 @@ Public Class ThreadWithState
3434
End Class
3535

3636
' Delegate that defines the signature for the callback method.
37-
'
3837
Public Delegate Sub ExampleCallback(lineCount As Integer)
3938

40-
Public Class Example
39+
Public Class Example2
4140
Public Shared Sub Main()
4241
' Supply the state information required by the task.
43-
Dim tws As New ThreadWithState( _
42+
Dim tws As New ThreadWithState2( _
4443
"This report displays the number {0}.", _
4544
42, _
4645
AddressOf ResultCallback)

0 commit comments

Comments
 (0)