Skip to content

Commit e83a584

Browse files
paul1956Ron Petrusha
authored andcommitted
Clean up issues in a few C# projects, remove Me, ByVal and other code… (#1391)
* Clean up issues in a few C# projects, remove Me, ByRef and other code cleanup. * Fix Snippet while still adding ConfigureGeneratedCodeAnalysis and EnableConcurrentExecution. * FIx Typo in project file * Restore DataTime from DAte * respond to PR feedback * Fix Byval and spacing in some VB files * Update Form1.vb * Update quickcontacts.vb
1 parent 5fc2989 commit e83a584

File tree

31 files changed

+227
-266
lines changed

31 files changed

+227
-266
lines changed

csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConst.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard1.3</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<IncludeBuildOutput>false</IncludeBuildOutput>
66
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
77
</PropertyGroup>

csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConstAnalyzer.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ public class MakeConstAnalyzer : DiagnosticAnalyzer
2828

2929
public override void Initialize(AnalysisContext context)
3030
{
31-
// See https://github.com/dotnet/roslyn/blob/master/docs/analyzers/Analyzer%20Actions%20Semantics.md for more information
32-
// <SnippetRegisterNodeAction>
31+
// See https://github.com/dotnet/roslyn/blob/master/docs/analyzers/Analyzer%20Actions%20Semantics.md for more information
32+
// <SnippetRegisterNodeAction>
33+
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.None);
34+
context.EnableConcurrentExecution();
3335
context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.LocalDeclarationStatement);
3436
// </SnippetRegisterNodeAction>
3537
}

snippets/common/VS_Snippets_CFX/c_howtousechannelfactory/source.vb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
Imports System.ServiceModel
33

44
' This code generated by svcutil.exe.
5-
<ServiceContract()> _
5+
<ServiceContract()>
66
Interface IMath
7-
<OperationContract()> _
8-
Function Add(ByVal A As Double, ByVal B As Double) As Double
9-
End Interface
7+
<OperationContract()>
8+
Function Add(A As Double, B As Double) As Double
9+
End Interface
1010

11-
public class Math
11+
Public Class Math
1212
Implements IMath
1313

14-
Function Add(ByVal A As Double, ByVal B As Double) As Double Implements IMath.Add
15-
Return A + B
14+
Function Add(A As Double, B As Double) As Double Implements IMath.Add
15+
Return A + B
1616
End Function
1717
End Class
1818

@@ -24,10 +24,10 @@ Public Class Test
2424
' This code is written by an application developer.
2525
' Create a channel factory.
2626
Dim myBinding As New BasicHttpBinding
27-
Dim myEndpoint As New EndpointAddress("http://localhost/MathService/Ep1")
27+
Dim myEndpoint As New EndpointAddress("http://localhost/MathService/Ep1")
2828

29-
Dim myChannelFactory As ChannelFactory(Of IMath) = _
30-
New ChannelFactory(Of IMath) (myBinding, myEndpoint)
29+
Dim myChannelFactory As ChannelFactory(Of IMath) =
30+
New ChannelFactory(Of IMath)(myBinding, myEndpoint)
3131

3232
'Create a channel.
3333
Dim proxy1 As IMath = myChannelFactory.CreateChannel()
@@ -40,4 +40,4 @@ Public Class Test
4040
Console.WriteLine(s.ToString())
4141
End Sub
4242
End Class
43-
' </snippet1>
43+
' </snippet1>

snippets/common/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
Protected catalog As ListDictionary
66
Protected returnValue As String
7-
Sub Page_Load(ByVal sender As Object, ByVal e As _
8-
System.EventArgs) Handles Me.Load
7+
Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
98
Dim cbReference As String
10-
cbReference = Page.ClientScript.GetCallbackEventReference(Me, _
9+
cbReference = Page.ClientScript.GetCallbackEventReference(Me,
1110
"arg", "ReceiveServerData", "context")
1211
Dim callbackScript As String = ""
13-
callbackScript &= "function CallServer(arg, context) { " & _
12+
callbackScript &= "function CallServer(arg, context) { " &
1413
cbReference & "} ;"
15-
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _
14+
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
1615
"CallServer", callbackScript, True)
1716

1817
' Populate List Dictionary with invented database data
@@ -27,7 +26,7 @@
2726
ListBox1.DataBind()
2827
End Sub
2928

30-
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
29+
Public Sub RaiseCallbackEvent(eventArgument As String) _
3130
Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
3231

3332
If catalog(eventArgument) Is Nothing Then
@@ -46,4 +45,4 @@
4645

4746
End Function
4847

49-
End Class
48+
End Class

snippets/common/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Namespace Samples.AspNet.VB.Controls
3838
End Property
3939

4040
' The contacts are rendered in an HTML table.
41-
Protected Overrides Sub RenderContents( _
42-
ByVal writer As HtmlTextWriter)
41+
Protected Overrides Sub RenderContents(writer As HtmlTextWriter)
4342
Dim t As Table = CreateContactsTable()
4443
If t IsNot Nothing Then
4544
t.RenderControl(writer)
@@ -55,12 +54,14 @@ Namespace Samples.AspNet.VB.Controls
5554
Dim aContact As Contact = TryCast(item, Contact)
5655
If aContact IsNot Nothing Then
5756
Dim r As New TableRow
58-
Dim c1 As New TableCell
59-
c1.Text = aContact.Name
57+
Dim c1 As New TableCell With {
58+
.Text = aContact.Name
59+
}
6060
r.Controls.Add(c1)
6161

62-
Dim c2 As New TableCell
63-
c2.Text = aContact.Email
62+
Dim c2 As New TableCell With {
63+
.Text = aContact.Email
64+
}
6465
r.Controls.Add(c2)
6566

6667
Dim c3 As New TableCell

snippets/cpp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
Protected catalog As ListDictionary
66
Protected returnValue As String
7-
Sub Page_Load(ByVal sender As Object, ByVal e As _
8-
System.EventArgs) Handles Me.Load
7+
Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
98
Dim cbReference As String
10-
cbReference = Page.ClientScript.GetCallbackEventReference(Me, _
9+
cbReference = Page.ClientScript.GetCallbackEventReference(Me,
1110
"arg", "ReceiveServerData", "context")
1211
Dim callbackScript As String = ""
13-
callbackScript &= "function CallServer(arg, context) { " & _
12+
callbackScript &= "function CallServer(arg, context) { " &
1413
cbReference & "} ;"
15-
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _
14+
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
1615
"CallServer", callbackScript, True)
1716

1817
' Populate List Dictionary with invented database data
@@ -27,7 +26,7 @@
2726
ListBox1.DataBind()
2827
End Sub
2928

30-
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
29+
Public Sub RaiseCallbackEvent(eventArgument As String) _
3130
Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
3231

3332
If catalog(eventArgument) Is Nothing Then
@@ -46,4 +45,4 @@
4645

4746
End Function
4847

49-
End Class
48+
End Class

snippets/csharp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
Protected catalog As ListDictionary
66
Protected returnValue As String
7-
Sub Page_Load(ByVal sender As Object, ByVal e As _
8-
System.EventArgs) Handles Me.Load
7+
Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
98
Dim cbReference As String
10-
cbReference = Page.ClientScript.GetCallbackEventReference(Me, _
9+
cbReference = Page.ClientScript.GetCallbackEventReference(Me,
1110
"arg", "ReceiveServerData", "context")
1211
Dim callbackScript As String = ""
13-
callbackScript &= "function CallServer(arg, context) { " & _
12+
callbackScript &= "function CallServer(arg, context) { " &
1413
cbReference & "} ;"
15-
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _
14+
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
1615
"CallServer", callbackScript, True)
1716

1817
' Populate List Dictionary with invented database data
@@ -27,7 +26,7 @@
2726
ListBox1.DataBind()
2827
End Sub
2928

30-
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
29+
Public Sub RaiseCallbackEvent(eventArgument As String) _
3130
Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
3231

3332
If catalog(eventArgument) Is Nothing Then
@@ -46,4 +45,4 @@
4645

4746
End Function
4847

49-
End Class
48+
End Class

snippets/csharp/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Namespace Samples.AspNet.VB.Controls
3838
End Property
3939

4040
' The contacts are rendered in an HTML table.
41-
Protected Overrides Sub RenderContents( _
42-
ByVal writer As HtmlTextWriter)
41+
Protected Overrides Sub RenderContents(writer As HtmlTextWriter)
4342
Dim t As Table = CreateContactsTable()
4443
If t IsNot Nothing Then
4544
t.RenderControl(writer)

snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
Protected catalog As ListDictionary
66
Protected returnValue As String
7-
Sub Page_Load(ByVal sender As Object, ByVal e As _
8-
System.EventArgs) Handles Me.Load
7+
Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
98
Dim cbReference As String
10-
cbReference = Page.ClientScript.GetCallbackEventReference(Me, _
9+
cbReference = Page.ClientScript.GetCallbackEventReference(Me,
1110
"arg", "ReceiveServerData", "context")
1211
Dim callbackScript As String = ""
13-
callbackScript &= "function CallServer(arg, context) { " & _
12+
callbackScript &= "function CallServer(arg, context) { " &
1413
cbReference & "} ;"
15-
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _
14+
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
1615
"CallServer", callbackScript, True)
1716

1817
' Populate List Dictionary with invented database data
@@ -27,7 +26,7 @@
2726
ListBox1.DataBind()
2827
End Sub
2928

30-
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
29+
Public Sub RaiseCallbackEvent(eventArgument As String) _
3130
Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
3231

3332
If catalog(eventArgument) Is Nothing Then
@@ -46,4 +45,4 @@
4645

4746
End Function
4847

49-
End Class
48+
End Class

snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/vb/ClientCallback.aspx.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Partial Class ClientCallback
55

66
Protected catalog As ListDictionary
77
Protected returnValue As String
8-
Sub Page_Load(ByVal sender As Object, ByVal e As _
9-
System.EventArgs) Handles Me.Load
8+
Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
109
Dim cbReference As String
11-
cbReference = Page.ClientScript.GetCallbackEventReference(Me, _
10+
cbReference = Page.ClientScript.GetCallbackEventReference(Me,
1211
"arg", "ReceiveServerData", "context")
1312
Dim callbackScript As String = ""
14-
callbackScript &= "function CallServer(arg, context) { " & _
13+
callbackScript &= "function CallServer(arg, context) { " &
1514
cbReference & "} ;"
16-
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _
15+
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
1716
"CallServer", callbackScript, True)
1817

1918
' Populate List Dictionary with invented database data
@@ -28,7 +27,7 @@ Partial Class ClientCallback
2827
ListBox1.DataBind()
2928
End Sub
3029

31-
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
30+
Public Sub RaiseCallbackEvent(eventArgument As String) _
3231
Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
3332

3433
If catalog(eventArgument) Is Nothing Then
@@ -48,4 +47,4 @@ Partial Class ClientCallback
4847
End Function
4948

5049
End Class
51-
' </Snippet4>
50+
' </Snippet4>

0 commit comments

Comments
 (0)