From e83a584cdbb1ceffd274ab97fa18d874d87c05b4 Mon Sep 17 00:00:00 2001 From: Paul M Cohen Date: Thu, 12 Sep 2019 15:21:01 -0700 Subject: [PATCH] =?UTF-8?q?Clean=20up=20issues=20in=20a=20few=20C#=20proje?= =?UTF-8?q?cts,=20remove=20Me,=20ByVal=20and=20other=20code=E2=80=A6=20(#1?= =?UTF-8?q?391)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .../MakeConst/MakeConst/MakeConst.csproj | 4 +- .../MakeConst/MakeConst/MakeConstAnalyzer.cs | 6 +- .../c_howtousechannelfactory/source.vb | 22 ++--- .../clientcallback.aspx.vb | 13 ++- .../samples.aspnet.vb/quickcontacts.vb | 13 +-- .../clientcallback.aspx.vb | 13 ++- .../clientcallback.aspx.vb | 13 ++- .../samples.aspnet.vb/quickcontacts.vb | 3 +- .../clientcallback.aspx.vb | 13 ++- .../vb/ClientCallback.aspx.vb | 13 ++- .../vb/ClientCallback.aspx.vb | 39 ++++---- .../visualbasic/acceldecelexample.vb | 14 +-- .../visualbasic/animationclockexample.vb | 6 +- .../visualbasic/autoreverseexample.vb | 10 +- .../visualbasic/begintimeexample.vb | 10 +- .../visualbasic/clockcontrollerexample.vb | 2 +- .../clockcontrollerspeedratioexample.vb | 2 +- .../visualbasic/controlstoryboardexample.vb | 8 +- .../visualbasic/fillbehaviorexample.vb | 8 +- .../visualbasic/opacityanimationexample.vb | 12 +-- .../visualbasic/repeatbehaviorexample.vb | 20 ++-- .../visualbasic/sampleviewer.xaml.vb | 20 ++-- .../visualbasic/seekstoryboardexample.vb | 4 +- .../visualbasic/speedexample.vb | 10 +- .../error-messages/bc30451/Program1.vb | 6 +- .../data-types/named-tuples/Program.vb | 16 ++-- .../passing-named-arguments/module1.vb | 6 +- .../CSWinFormDataGridView.csproj | 16 ++-- .../Properties/AssemblyInfo.cs | 36 ------- .../WinFormGraphics_vb/MainForm.Designer.vb | 42 ++++----- winforms/formatting-utility/vb/Form1.vb | 93 ++++++++++--------- 31 files changed, 227 insertions(+), 266 deletions(-) delete mode 100644 windowsforms/datagridview/CSWinFormDataGridView/Properties/AssemblyInfo.cs diff --git a/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConst.csproj b/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConst.csproj index dc41958db1b..47fb5fbdef6 100644 --- a/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConst.csproj +++ b/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConst.csproj @@ -1,7 +1,7 @@ - + - netstandard1.3 + netstandard2.0 false True diff --git a/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConstAnalyzer.cs b/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConstAnalyzer.cs index 3e7e651e8c1..41e2ef53a1e 100644 --- a/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConstAnalyzer.cs +++ b/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst/MakeConstAnalyzer.cs @@ -28,8 +28,10 @@ public class MakeConstAnalyzer : DiagnosticAnalyzer public override void Initialize(AnalysisContext context) { - // See https://github.com/dotnet/roslyn/blob/master/docs/analyzers/Analyzer%20Actions%20Semantics.md for more information - // + // See https://github.com/dotnet/roslyn/blob/master/docs/analyzers/Analyzer%20Actions%20Semantics.md for more information + // + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.None); + context.EnableConcurrentExecution(); context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.LocalDeclarationStatement); // } diff --git a/snippets/common/VS_Snippets_CFX/c_howtousechannelfactory/source.vb b/snippets/common/VS_Snippets_CFX/c_howtousechannelfactory/source.vb index 73fbaa814e5..f6c5ff6b675 100644 --- a/snippets/common/VS_Snippets_CFX/c_howtousechannelfactory/source.vb +++ b/snippets/common/VS_Snippets_CFX/c_howtousechannelfactory/source.vb @@ -2,17 +2,17 @@ Imports System.ServiceModel ' This code generated by svcutil.exe. - _ + Interface IMath - _ - Function Add(ByVal A As Double, ByVal B As Double) As Double -End Interface + + Function Add(A As Double, B As Double) As Double +End Interface -public class Math +Public Class Math Implements IMath - Function Add(ByVal A As Double, ByVal B As Double) As Double Implements IMath.Add - Return A + B + Function Add(A As Double, B As Double) As Double Implements IMath.Add + Return A + B End Function End Class @@ -24,10 +24,10 @@ Public Class Test ' This code is written by an application developer. ' Create a channel factory. Dim myBinding As New BasicHttpBinding - Dim myEndpoint As New EndpointAddress("http://localhost/MathService/Ep1") + Dim myEndpoint As New EndpointAddress("http://localhost/MathService/Ep1") - Dim myChannelFactory As ChannelFactory(Of IMath) = _ - New ChannelFactory(Of IMath) (myBinding, myEndpoint) + Dim myChannelFactory As ChannelFactory(Of IMath) = + New ChannelFactory(Of IMath)(myBinding, myEndpoint) 'Create a channel. Dim proxy1 As IMath = myChannelFactory.CreateChannel() @@ -40,4 +40,4 @@ Public Class Test Console.WriteLine(s.ToString()) End Sub End Class -' \ No newline at end of file +' diff --git a/snippets/common/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb b/snippets/common/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb index 64f3a98d914..4408fc70d39 100644 --- a/snippets/common/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb +++ b/snippets/common/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb @@ -4,15 +4,14 @@ Protected catalog As ListDictionary Protected returnValue As String - Sub Page_Load(ByVal sender As Object, ByVal e As _ - System.EventArgs) Handles Me.Load + Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim cbReference As String - cbReference = Page.ClientScript.GetCallbackEventReference(Me, _ + cbReference = Page.ClientScript.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context") Dim callbackScript As String = "" - callbackScript &= "function CallServer(arg, context) { " & _ + callbackScript &= "function CallServer(arg, context) { " & cbReference & "} ;" - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) ' Populate List Dictionary with invented database data @@ -27,7 +26,7 @@ ListBox1.DataBind() End Sub - Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _ + Public Sub RaiseCallbackEvent(eventArgument As String) _ Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent If catalog(eventArgument) Is Nothing Then @@ -46,4 +45,4 @@ End Function -End Class \ No newline at end of file +End Class diff --git a/snippets/common/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb b/snippets/common/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb index f87b1834a82..cbed19de3dc 100644 --- a/snippets/common/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb +++ b/snippets/common/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb @@ -38,8 +38,7 @@ Namespace Samples.AspNet.VB.Controls End Property ' The contacts are rendered in an HTML table. - Protected Overrides Sub RenderContents( _ - ByVal writer As HtmlTextWriter) + Protected Overrides Sub RenderContents(writer As HtmlTextWriter) Dim t As Table = CreateContactsTable() If t IsNot Nothing Then t.RenderControl(writer) @@ -55,12 +54,14 @@ Namespace Samples.AspNet.VB.Controls Dim aContact As Contact = TryCast(item, Contact) If aContact IsNot Nothing Then Dim r As New TableRow - Dim c1 As New TableCell - c1.Text = aContact.Name + Dim c1 As New TableCell With { + .Text = aContact.Name + } r.Controls.Add(c1) - Dim c2 As New TableCell - c2.Text = aContact.Email + Dim c2 As New TableCell With { + .Text = aContact.Email + } r.Controls.Add(c2) Dim c3 As New TableCell diff --git a/snippets/cpp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb b/snippets/cpp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb index 64f3a98d914..4408fc70d39 100644 --- a/snippets/cpp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb +++ b/snippets/cpp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb @@ -4,15 +4,14 @@ Protected catalog As ListDictionary Protected returnValue As String - Sub Page_Load(ByVal sender As Object, ByVal e As _ - System.EventArgs) Handles Me.Load + Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim cbReference As String - cbReference = Page.ClientScript.GetCallbackEventReference(Me, _ + cbReference = Page.ClientScript.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context") Dim callbackScript As String = "" - callbackScript &= "function CallServer(arg, context) { " & _ + callbackScript &= "function CallServer(arg, context) { " & cbReference & "} ;" - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) ' Populate List Dictionary with invented database data @@ -27,7 +26,7 @@ ListBox1.DataBind() End Sub - Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _ + Public Sub RaiseCallbackEvent(eventArgument As String) _ Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent If catalog(eventArgument) Is Nothing Then @@ -46,4 +45,4 @@ End Function -End Class \ No newline at end of file +End Class diff --git a/snippets/csharp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb b/snippets/csharp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb index 64f3a98d914..4408fc70d39 100644 --- a/snippets/csharp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb +++ b/snippets/csharp/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb @@ -4,15 +4,14 @@ Protected catalog As ListDictionary Protected returnValue As String - Sub Page_Load(ByVal sender As Object, ByVal e As _ - System.EventArgs) Handles Me.Load + Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim cbReference As String - cbReference = Page.ClientScript.GetCallbackEventReference(Me, _ + cbReference = Page.ClientScript.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context") Dim callbackScript As String = "" - callbackScript &= "function CallServer(arg, context) { " & _ + callbackScript &= "function CallServer(arg, context) { " & cbReference & "} ;" - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) ' Populate List Dictionary with invented database data @@ -27,7 +26,7 @@ ListBox1.DataBind() End Sub - Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _ + Public Sub RaiseCallbackEvent(eventArgument As String) _ Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent If catalog(eventArgument) Is Nothing Then @@ -46,4 +45,4 @@ End Function -End Class \ No newline at end of file +End Class diff --git a/snippets/csharp/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb b/snippets/csharp/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb index f87b1834a82..e37a28fc465 100644 --- a/snippets/csharp/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb +++ b/snippets/csharp/VS_Snippets_WebNet/CustomServerControlCollectionProperties/projectsample/customservercontrolcollection/samples.aspnet.vb/quickcontacts.vb @@ -38,8 +38,7 @@ Namespace Samples.AspNet.VB.Controls End Property ' The contacts are rendered in an HTML table. - Protected Overrides Sub RenderContents( _ - ByVal writer As HtmlTextWriter) + Protected Overrides Sub RenderContents(writer As HtmlTextWriter) Dim t As Table = CreateContactsTable() If t IsNot Nothing Then t.RenderControl(writer) diff --git a/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb b/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb index 64f3a98d914..4408fc70d39 100644 --- a/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb +++ b/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/projectsample/clientcallbackexamplevb/clientcallback.aspx.vb @@ -4,15 +4,14 @@ Protected catalog As ListDictionary Protected returnValue As String - Sub Page_Load(ByVal sender As Object, ByVal e As _ - System.EventArgs) Handles Me.Load + Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim cbReference As String - cbReference = Page.ClientScript.GetCallbackEventReference(Me, _ + cbReference = Page.ClientScript.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context") Dim callbackScript As String = "" - callbackScript &= "function CallServer(arg, context) { " & _ + callbackScript &= "function CallServer(arg, context) { " & cbReference & "} ;" - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) ' Populate List Dictionary with invented database data @@ -27,7 +26,7 @@ ListBox1.DataBind() End Sub - Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _ + Public Sub RaiseCallbackEvent(eventArgument As String) _ Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent If catalog(eventArgument) Is Nothing Then @@ -46,4 +45,4 @@ End Function -End Class \ No newline at end of file +End Class diff --git a/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/vb/ClientCallback.aspx.vb b/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/vb/ClientCallback.aspx.vb index 27bd9f245e2..c08d3e75f60 100644 --- a/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/vb/ClientCallback.aspx.vb +++ b/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample/vb/ClientCallback.aspx.vb @@ -5,15 +5,14 @@ Partial Class ClientCallback Protected catalog As ListDictionary Protected returnValue As String - Sub Page_Load(ByVal sender As Object, ByVal e As _ - System.EventArgs) Handles Me.Load + Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim cbReference As String - cbReference = Page.ClientScript.GetCallbackEventReference(Me, _ + cbReference = Page.ClientScript.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context") Dim callbackScript As String = "" - callbackScript &= "function CallServer(arg, context) { " & _ + callbackScript &= "function CallServer(arg, context) { " & cbReference & "} ;" - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) ' Populate List Dictionary with invented database data @@ -28,7 +27,7 @@ Partial Class ClientCallback ListBox1.DataBind() End Sub - Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _ + Public Sub RaiseCallbackEvent(eventArgument As String) _ Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent If catalog(eventArgument) Is Nothing Then @@ -48,4 +47,4 @@ Partial Class ClientCallback End Function End Class -' \ No newline at end of file +' diff --git a/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample2/vb/ClientCallback.aspx.vb b/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample2/vb/ClientCallback.aspx.vb index f941eda12d7..1262fafa390 100644 --- a/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample2/vb/ClientCallback.aspx.vb +++ b/snippets/visualbasic/VS_Snippets_WebNet/ConceptualClientCallbackExample2/vb/ClientCallback.aspx.vb @@ -11,32 +11,31 @@ Partial Class ClientCallback Protected validationLookUpStock As String = "LookUpStock" Protected validationLookUpSale As String = "LookUpSale" ' - Sub Page_Load(ByVal sender As Object, ByVal e As _ - System.EventArgs) Handles Me.Load + Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ - validationLookUpStock, "function LookUpStock() { " & _ - "var lb = document.forms[0].ListBox1; " & _ - "if (lb.selectedIndex == -1) { alert ('Please make a selection.'); return; } " & _ - "var product = lb.options[lb.selectedIndex].text; " & _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), + validationLookUpStock, "function LookUpStock() { " & + "var lb = document.forms[0].ListBox1; " & + "if (lb.selectedIndex == -1) { alert ('Please make a selection.'); return; } " & + "var product = lb.options[lb.selectedIndex].text; " & "CallServer(product, ""LookUpStock"");} ", True) If (User.Identity.IsAuthenticated) Then - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ - validationLookUpSale, "function LookUpSale() { " & _ - "var lb = document.forms[0].ListBox1; " & _ - "if (lb.selectedIndex == -1) { alert ('Please make a selection.'); return; } " & _ - "var product = lb.options[lb.selectedIndex].text; " & _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), + validationLookUpSale, "function LookUpSale() { " & + "var lb = document.forms[0].ListBox1; " & + "if (lb.selectedIndex == -1) { alert ('Please make a selection.'); return; } " & + "var product = lb.options[lb.selectedIndex].text; " & "CallServer(product, ""LookUpSale"");} ", True) End If Dim cbReference As String - cbReference = "var param = arg + '|' + context;" & _ - Page.ClientScript.GetCallbackEventReference(Me, _ + cbReference = "var param = arg + '|' + context;" & + Page.ClientScript.GetCallbackEventReference(Me, "param", "ReceiveServerData", "context") Dim callbackScript As String = "" - callbackScript &= "function CallServer(arg, context) { " & _ + callbackScript &= "function CallServer(arg, context) { " & cbReference & "} ;" - Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ + Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) ' Populate List Dictionary with invented database data @@ -113,15 +112,15 @@ Partial Class ClientCallback ' ' - Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) - Page.ClientScript.RegisterForEventValidation("LookUpStockButton", _ + Protected Overrides Sub Render(writer As System.Web.UI.HtmlTextWriter) + Page.ClientScript.RegisterForEventValidation("LookUpStockButton", validationLookUpStock) If (User.Identity.IsAuthenticated) Then - Page.ClientScript.RegisterForEventValidation("LookUpSaleButton", _ + Page.ClientScript.RegisterForEventValidation("LookUpSaleButton", validationLookUpSale) End If MyBase.Render(writer) End Sub ' End Class -' \ No newline at end of file +' diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/acceldecelexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/acceldecelexample.vb index 324e68d4a77..55717165d80 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/acceldecelexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/acceldecelexample.vb @@ -22,7 +22,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' Create a name scope for the page. NameScope.SetNameScope(Me, New NameScope()) - Me.WindowTitle = "Acceleration and Deceleration Example" + WindowTitle = "Acceleration and Deceleration Example" Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) @@ -34,7 +34,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim nonAcceleratedOrDeceleratedRectangle As New Rectangle With { .Name = "nonAcceleratedOrDeceleratedRectangle" } - Me.RegisterName(nonAcceleratedOrDeceleratedRectangle.Name, nonAcceleratedOrDeceleratedRectangle) + RegisterName(nonAcceleratedOrDeceleratedRectangle.Name, nonAcceleratedOrDeceleratedRectangle) nonAcceleratedOrDeceleratedRectangle.Width = 10 nonAcceleratedOrDeceleratedRectangle.Height = 20 Dim mySolidColorBrush As New SolidColorBrush(Color.FromArgb(251, 153, 51, 255)) @@ -45,7 +45,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim acceleratedRectangle As New Rectangle With { .Name = "acceleratedRectangle" } - Me.RegisterName(acceleratedRectangle.Name, acceleratedRectangle) + RegisterName(acceleratedRectangle.Name, acceleratedRectangle) acceleratedRectangle.Width = 10 acceleratedRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(251, 51, 51, 255)) @@ -56,7 +56,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim deceleratedRectangle As New Rectangle With { .Name = "deceleratedRectangle" } - Me.RegisterName(deceleratedRectangle.Name, deceleratedRectangle) + RegisterName(deceleratedRectangle.Name, deceleratedRectangle) deceleratedRectangle.Width = 10 deceleratedRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(251, 51, 255, 102)) @@ -67,7 +67,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim acceleratedAndDeceleratedRectangle As New Rectangle With { .Name = "acceleratedAndDeceleratedRectangle" } - Me.RegisterName(acceleratedAndDeceleratedRectangle.Name, acceleratedAndDeceleratedRectangle) + RegisterName(acceleratedAndDeceleratedRectangle.Name, acceleratedAndDeceleratedRectangle) acceleratedAndDeceleratedRectangle.Width = 10 acceleratedAndDeceleratedRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(251, 204, 255, 51)) @@ -157,8 +157,8 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors myEventTrigger.Actions.Add(myBeginStoryboard) myStackPanel.Triggers.Add(myEventTrigger) - Me.Content = myStackPanel + Content = myStackPanel - End Sub + End Sub End Class End Namespace diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/animationclockexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/animationclockexample.vb index 6af31f3de95..52a7c6359f8 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/animationclockexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/animationclockexample.vb @@ -20,8 +20,8 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Public Sub New() - Me.WindowTitle = "Opacity Animation Example" - Me.Background = Brushes.White + WindowTitle = "Opacity Animation Example" + Background = Brushes.White Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) } @@ -43,7 +43,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors AddHandler myButton.Click, AddressOf myButton_Clicked myStackPanel.Children.Add(myButton) - Me.Content = myStackPanel + Content = myStackPanel End Sub ' Create and apply and animation when the button is clicked. diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/autoreverseexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/autoreverseexample.vb index 766e841b255..9940078e25b 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/autoreverseexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/autoreverseexample.vb @@ -47,7 +47,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim withoutAutoReverseRectangle As New Rectangle With { .Name = "withoutAutoReverseRectangle" } - Me.RegisterName(withoutAutoReverseRectangle.Name,withoutAutoReverseRectangle) + RegisterName(withoutAutoReverseRectangle.Name,withoutAutoReverseRectangle) withoutAutoReverseRectangle.Width = 100 withoutAutoReverseRectangle.Height = 20 Dim mySolidColorBrush As New SolidColorBrush(Color.FromArgb(170,51,51,255)) @@ -64,7 +64,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim autoReverseRectangle As New Rectangle With { .Name = "autoReverseRectangle" } - Me.RegisterName(autoReverseRectangle.Name, autoReverseRectangle) + RegisterName(autoReverseRectangle.Name, autoReverseRectangle) autoReverseRectangle.Width = 100 autoReverseRectangle.Height = 20 autoReverseRectangle.Fill = mySolidColorBrush @@ -80,7 +80,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim autoReverseRectangleWithRepeats As New Rectangle With { .Name = "autoReverseRectangleWithRepeats" } - Me.RegisterName(autoReverseRectangleWithRepeats.Name, autoReverseRectangleWithRepeats) + RegisterName(autoReverseRectangleWithRepeats.Name, autoReverseRectangleWithRepeats) autoReverseRectangleWithRepeats.Width = 100 autoReverseRectangleWithRepeats.Height = 20 autoReverseRectangleWithRepeats.Fill = mySolidColorBrush @@ -98,7 +98,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim complexAutoReverseExample As New Rectangle With { .Name = "complexAutoReverseExample" } - Me.RegisterName(complexAutoReverseExample.Name, complexAutoReverseExample) + RegisterName(complexAutoReverseExample.Name, complexAutoReverseExample) complexAutoReverseExample.Width = 100 complexAutoReverseExample.Height = 20 complexAutoReverseExample.Fill = mySolidColorBrush @@ -190,7 +190,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors } myEventTrigger.Actions.Add(myBeginStoryboard) myStackPanel.Triggers.Add(myEventTrigger) - Me.Content = myStackPanel + Content = myStackPanel End Sub End Class End Namespace diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/begintimeexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/begintimeexample.vb index 2ef0415aa3e..ddc93135e5c 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/begintimeexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/begintimeexample.vb @@ -21,7 +21,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' Create a name scope for the page. NameScope.SetNameScope(Me, New NameScope()) - Me.WindowTitle = "BeginTime Example" + WindowTitle = "BeginTime Example" Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) @@ -51,7 +51,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim defaultBeginTimeRectangle As New Rectangle With { .Name = "defaultBeginTimeRectangle" } - Me.RegisterName(defaultBeginTimeRectangle.Name, defaultBeginTimeRectangle) + RegisterName(defaultBeginTimeRectangle.Name, defaultBeginTimeRectangle) defaultBeginTimeRectangle.Width = 20 defaultBeginTimeRectangle.Height = 20 myColor = New Color() @@ -69,7 +69,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim delayedBeginTimeRectangle As New Rectangle With { .Name = "delayedBeginTimeRectangle" } - Me.RegisterName(delayedBeginTimeRectangle.Name, delayedBeginTimeRectangle) + RegisterName(delayedBeginTimeRectangle.Name, delayedBeginTimeRectangle) delayedBeginTimeRectangle.Width = 20 delayedBeginTimeRectangle.Height = 20 myColor = New Color() @@ -87,7 +87,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim delayedAnimationWithDelayedParentRectangle As New Rectangle With { .Name = "delayedAnimationWithDelayedParentRectangle" } - Me.RegisterName(delayedAnimationWithDelayedParentRectangle.Name, delayedAnimationWithDelayedParentRectangle) + RegisterName(delayedAnimationWithDelayedParentRectangle.Name, delayedAnimationWithDelayedParentRectangle) delayedAnimationWithDelayedParentRectangle.Width = 20 delayedAnimationWithDelayedParentRectangle.Height = 20 myColor = New Color() @@ -171,7 +171,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors myEventTrigger.Actions.Add(myBeginStoryboard) myStackPanel.Triggers.Add(myEventTrigger) - Me.Content = myStackPanel + Content = myStackPanel End Sub End Class End Namespace diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerexample.vb index b4f8bce17f9..e92eed5fec2 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerexample.vb @@ -127,7 +127,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors seekDetailsPanel.Children.Add(seekButton) mainPanel.Children.Add(seekDetailsPanel) - Me.Content = mainPanel + Content = mainPanel End Sub ' Starts the clock. diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerspeedratioexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerspeedratioexample.vb index 00da6b5467a..78b917fb25c 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerspeedratioexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/clockcontrollerspeedratioexample.vb @@ -90,7 +90,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' List for speed changes. AddHandler myControllableClock.CurrentGlobalSpeedInvalidated, AddressOf myControllableClock_currentGlobalSpeedInvalidated - Me.Content = mainPanel + Content = mainPanel End Sub diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/controlstoryboardexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/controlstoryboardexample.vb index c289cda6837..d7a90950301 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/controlstoryboardexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/controlstoryboardexample.vb @@ -24,8 +24,8 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' Create a name scope for the page. NameScope.SetNameScope(Me, New NameScope()) - Me.WindowTitle = "Controlling a Storyboard" - Me.Background = Brushes.White + WindowTitle = "Controlling a Storyboard" + Background = Brushes.White Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) @@ -45,7 +45,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' registering it with the page, so that ' it can be targeted by storyboard ' animations. - Me.RegisterName("myRectangle", myRectangle) + RegisterName("myRectangle", myRectangle) ' ' Create an animation and a storyboard to animate the @@ -95,7 +95,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors AddHandler stopButton.Click, AddressOf stopButton_Clicked buttonPanel.Children.Add(stopButton) myStackPanel.Children.Add(buttonPanel) - Me.Content = myStackPanel + Content = myStackPanel End Sub ' Begins the storyboard. diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/fillbehaviorexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/fillbehaviorexample.vb index 3d089bc87bf..914ddc282c6 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/fillbehaviorexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/fillbehaviorexample.vb @@ -51,7 +51,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim deactivateAnimationRectangle As New Rectangle With { .Name = "deactivateAnimationRectangle" } - Me.RegisterName(deactivateAnimationRectangle.Name, deactivateAnimationRectangle) + RegisterName(deactivateAnimationRectangle.Name, deactivateAnimationRectangle) deactivateAnimationRectangle.Width = 20 deactivateAnimationRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(170,51,51,255)) @@ -70,7 +70,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim holdEndAnimationRectangle As New Rectangle With { .Name = "holdEndAnimationRectangle" } - Me.RegisterName(holdEndAnimationRectangle.Name, holdEndAnimationRectangle) + RegisterName(holdEndAnimationRectangle.Name, holdEndAnimationRectangle) holdEndAnimationRectangle.Width = 20 holdEndAnimationRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(170,51,51,255)) @@ -114,7 +114,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim myButton As New Button With { .Name = "myButton" } - Me.RegisterName(myButton.Name, myButton) + RegisterName(myButton.Name, myButton) myButton.Margin = New Thickness(0,30,0,0) myButton.Content = "Restart Animations" myButton.HorizontalAlignment = HorizontalAlignment.Left @@ -135,7 +135,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors myEventTrigger.Actions.Add(myBeginStoryboard) myStackPanel.Triggers.Add(myEventTrigger) - Me.Content = myStackPanel + Content = myStackPanel End Sub End Class End Namespace diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/opacityanimationexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/opacityanimationexample.vb index eab3fdf6dba..968d9d6bc18 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/opacityanimationexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/opacityanimationexample.vb @@ -22,8 +22,8 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' Create a name scope for the page. NameScope.SetNameScope(Me, New NameScope()) - Me.WindowTitle = "Opacity Animation Example" - Me.Background = Brushes.White + WindowTitle = "Opacity Animation Example" + Background = Brushes.White Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) @@ -35,7 +35,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim opacityAnimatedButton As New Button With { .Name = "opacityAnimatedButton" } - Me.RegisterName(opacityAnimatedButton.Name, opacityAnimatedButton) + RegisterName(opacityAnimatedButton.Name, opacityAnimatedButton) opacityAnimatedButton.Content = "A Button" myStackPanel.Children.Add(opacityAnimatedButton) @@ -77,10 +77,10 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim opacityBrushPaintedButton As New Button With { .Name = "opacityBrushPaintedButton" } - Me.RegisterName(opacityBrushPaintedButton.Name, opacityBrushPaintedButton) + RegisterName(opacityBrushPaintedButton.Name, opacityBrushPaintedButton) opacityBrushPaintedButton.Content = "A Button" Dim mySolidColorBrush As New SolidColorBrush() - Me.RegisterName("mySolidColorBrush", mySolidColorBrush) + RegisterName("mySolidColorBrush", mySolidColorBrush) mySolidColorBrush.Color = Colors.Orange opacityBrushPaintedButton.Background = mySolidColorBrush myStackPanel.Children.Add(opacityBrushPaintedButton) @@ -113,7 +113,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors myBackgroundOpacityBeginStoryboard.Storyboard = myBackgroundOpacityStoryboard myBackgroundOpacityEventTrigger.Actions.Add(myBackgroundOpacityBeginStoryboard) - Me.Content = myStackPanel + Content = myStackPanel End Sub End Class End Namespace diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/repeatbehaviorexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/repeatbehaviorexample.vb index 7dd2917de40..fa64e50adbf 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/repeatbehaviorexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/repeatbehaviorexample.vb @@ -19,12 +19,12 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' Create a name scope for the page. NameScope.SetNameScope(Me, New NameScope()) - Me.WindowTitle = "RepeatBehavior Example" + WindowTitle = "RepeatBehavior Example" Dim myBorder As New Border With { .HorizontalAlignment = HorizontalAlignment.Stretch } - Me.Content = myBorder + Content = myBorder Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) @@ -53,7 +53,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim foreverRepeatingRectangle As New Rectangle With { .Name = "foreverRepeatingRectangle" } - Me.RegisterName(foreverRepeatingRectangle.Name, foreverRepeatingRectangle) + RegisterName(foreverRepeatingRectangle.Name, foreverRepeatingRectangle) mySolidColorBrush = New SolidColorBrush(Color.FromArgb(170,51,51,255)) foreverRepeatingRectangle.Fill = mySolidColorBrush foreverRepeatingRectangle.Width = 50 @@ -71,7 +71,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim fourSecondsRepeatingRectangle As New Rectangle With { .Name = "fourSecondsRepeatingRectangle" } - Me.RegisterName(fourSecondsRepeatingRectangle.Name, fourSecondsRepeatingRectangle) + RegisterName(fourSecondsRepeatingRectangle.Name, fourSecondsRepeatingRectangle) fourSecondsRepeatingRectangle.Fill= mySolidColorBrush fourSecondsRepeatingRectangle.Width = 50 fourSecondsRepeatingRectangle.Height = 20 @@ -86,7 +86,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim twiceRepeatingRectangle As New Rectangle With { .Name = "twiceRepeatingRectangle" } - Me.RegisterName(twiceRepeatingRectangle.Name, twiceRepeatingRectangle) + RegisterName(twiceRepeatingRectangle.Name, twiceRepeatingRectangle) twiceRepeatingRectangle.Fill = mySolidColorBrush twiceRepeatingRectangle.Width = 50 twiceRepeatingRectangle.Height = 20 @@ -101,7 +101,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim halfRepeatingRectangle As New Rectangle With { .Name = "halfRepeatingRectangle" } - Me.RegisterName(halfRepeatingRectangle.Name, halfRepeatingRectangle) + RegisterName(halfRepeatingRectangle.Name, halfRepeatingRectangle) halfRepeatingRectangle.Fill = mySolidColorBrush halfRepeatingRectangle.Width = 50 @@ -117,7 +117,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim oneSecondRepeatingRectangle As New Rectangle With { .Name = "oneSecondRepeatingRectangle" } - Me.RegisterName(oneSecondRepeatingRectangle.Name, oneSecondRepeatingRectangle) + RegisterName(oneSecondRepeatingRectangle.Name, oneSecondRepeatingRectangle) oneSecondRepeatingRectangle.Fill = mySolidColorBrush oneSecondRepeatingRectangle.Width = 50 oneSecondRepeatingRectangle.Height = 20 @@ -202,14 +202,14 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim myRestartButton As New Button With { .Name = "restartButton" } - Me.RegisterName(myRestartButton.Name, myRestartButton) + RegisterName(myRestartButton.Name, myRestartButton) myRestartButton.Content = "Start Animations" myStackPanel1.Children.Add(myRestartButton) Dim myStopButton As New Button With { .Name = "stopButton" } - Me.RegisterName(myStopButton.Name, myStopButton) + RegisterName(myStopButton.Name, myStopButton) myStopButton.Content = "Stop" mySolidColorBrush = New SolidColorBrush(Color.FromArgb(102,153,0,255)) myStopButton.Background = mySolidColorBrush @@ -221,7 +221,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim myBeginStoryboard As New BeginStoryboard With { .Name = "myBeginStoryboard" } - Me.RegisterName(myBeginStoryboard.Name,myBeginStoryboard) + RegisterName(myBeginStoryboard.Name,myBeginStoryboard) myBeginStoryboard.Storyboard = myStoryboard Dim myEventTrigger As New EventTrigger With { diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/sampleviewer.xaml.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/sampleviewer.xaml.vb index 890fa7334a8..851bb5e3f95 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/sampleviewer.xaml.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/sampleviewer.xaml.vb @@ -34,19 +34,19 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Get Return theClock End Get - Set(ByVal value As Clock) - If theClock IsNot Nothing Then - RemoveHandler theClock.CurrentTimeInvalidated, AddressOf onClockTimeInvalidated + Set(value As Clock) + If theClock IsNot Nothing Then + RemoveHandler theClock.CurrentTimeInvalidated, AddressOf onClockTimeInvalidated - End If + End If - theClock = value + theClock = value - If theClock IsNot Nothing Then - AddHandler theClock.CurrentTimeInvalidated, AddressOf onClockTimeInvalidated - End If - End Set - End Property + If theClock IsNot Nothing Then + AddHandler theClock.CurrentTimeInvalidated, AddressOf onClockTimeInvalidated + End If + End Set + End Property Private Sub onClockTimeInvalidated(sender As Object, args As EventArgs) SetValue(CurrentTimeProperty, theClock.CurrentTime) diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/seekstoryboardexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/seekstoryboardexample.vb index f3c32e45447..fd941d782fe 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/seekstoryboardexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/seekstoryboardexample.vb @@ -33,7 +33,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' registering it with the page, so that ' it can be targeted by storyboard ' animations. - Me.RegisterName("myRectangle", myRectangle) + RegisterName("myRectangle", myRectangle) ' ' Create an animation and a storyboard to animate the @@ -63,7 +63,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors buttonPanel.Children.Add(seekStoryboardButton) myStackPanel.Children.Add(buttonPanel) - Me.Content = myStackPanel + Content = myStackPanel End Sub ' Begins the storyboard. diff --git a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/speedexample.vb b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/speedexample.vb index fb937a1f3d3..f70f7db6caa 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/speedexample.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic/speedexample.vb @@ -18,7 +18,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors ' Create a name scope for the page. NameScope.SetNameScope(Me, New NameScope()) - Me.WindowTitle = "Speed Example" + WindowTitle = "Speed Example" Dim myStackPanel As New StackPanel With { .Margin = New Thickness(20) @@ -35,7 +35,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim defaultSpeedRectangle As New Rectangle With { .Name = "defaultSpeedRectangle" } - Me.RegisterName(defaultSpeedRectangle.Name, defaultSpeedRectangle) + RegisterName(defaultSpeedRectangle.Name, defaultSpeedRectangle) defaultSpeedRectangle.Width = 20 defaultSpeedRectangle.Height = 20 Dim mySolidColorBrush As New SolidColorBrush(Color.FromArgb(170,51,51,255)) @@ -52,7 +52,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim fasterRectangle As New Rectangle With { .Name = "fasterRectangle" } - Me.RegisterName(fasterRectangle.Name, fasterRectangle) + RegisterName(fasterRectangle.Name, fasterRectangle) fasterRectangle.Width = 20 fasterRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(170,51,51,255)) @@ -69,7 +69,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors Dim slowerRectangle As New Rectangle With { .Name = "slowerRectangle" } - Me.RegisterName(slowerRectangle.Name, slowerRectangle) + RegisterName(slowerRectangle.Name, slowerRectangle) slowerRectangle.Width = 20 slowerRectangle.Height = 20 mySolidColorBrush = New SolidColorBrush(Color.FromArgb(170,51,51,255)) @@ -142,7 +142,7 @@ Namespace Microsoft.Samples.Animation.TimingBehaviors myEventTrigger.Actions.Add(myBeginStoryboard) myStackPanel.Triggers.Add(myEventTrigger) - Me.Content = myStackPanel + Content = myStackPanel End Sub End Class End Namespace diff --git a/snippets/visualbasic/language-reference/error-messages/bc30451/Program1.vb b/snippets/visualbasic/language-reference/error-messages/bc30451/Program1.vb index 40a36b70fa2..dce4938f94e 100644 --- a/snippets/visualbasic/language-reference/error-messages/bc30451/Program1.vb +++ b/snippets/visualbasic/language-reference/error-messages/bc30451/Program1.vb @@ -2,9 +2,9 @@ Public Module Example Sub Main(args As String()) - Dim originalValue = args(0) - Dim t = GetType(Int32) - Dim i = Conversions.ChangeType(originalValue, t) + Dim originalValue As String = args(0) + Dim t As Type = GetType(Int32) + Dim i As Int32 = Conversions.ChangeType(originalValue, t) Console.WriteLine($"'{originalValue}' --> {i}") End Sub End Module diff --git a/snippets/visualbasic/programming-guide/language-features/data-types/named-tuples/Program.vb b/snippets/visualbasic/programming-guide/language-features/data-types/named-tuples/Program.vb index 5ed9808bf2f..eced14b2a59 100644 --- a/snippets/visualbasic/programming-guide/language-features/data-types/named-tuples/Program.vb +++ b/snippets/visualbasic/programming-guide/language-features/data-types/named-tuples/Program.vb @@ -8,11 +8,11 @@ Module Program Private Sub CallExplicitlyNamed() ' - Dim state = "MI" - Dim stateName = "Michigan" - Dim capital = "Lansing" - Dim stateInfo = ( state:=state, stateName:=stateName, capital:=capital ) - Console.WriteLine($"{stateInfo.stateName}: 2-letter code: {stateInfo.State}, Capital {stateInfo.capital}") + Const state As String = "MI" + Const stateName As String = "Michigan" + Const capital As String = "Lansing" + Dim stateInfo = (state:=state, stateName:=stateName, capital:=capital) + Console.WriteLine($"{stateInfo.stateName}: 2-letter code: {stateInfo.state}, Capital {stateInfo.capital}") ' The example displays the following output: ' Michigan: 2-letter code: MI, Capital Lansing ' @@ -20,9 +20,9 @@ Module Program Private Sub CallImplicitlyNamed() ' - Dim state = "MI" - Dim stateName = "Michigan" - Dim capital = "Lansing" + Const state As String = "MI" + Const stateName As String = "Michigan" + Const capital As String = "Lansing" Dim stateInfo = ( state, stateName, capital ) Console.WriteLine($"{stateInfo.stateName}: 2-letter code: {stateInfo.State}, Capital {stateInfo.capital}") ' The example displays the following output: diff --git a/snippets/visualbasic/programming-guide/language-features/passing-named-arguments/module1.vb b/snippets/visualbasic/programming-guide/language-features/passing-named-arguments/module1.vb index 80fa94846c8..a694c16bb9c 100644 --- a/snippets/visualbasic/programming-guide/language-features/passing-named-arguments/module1.vb +++ b/snippets/visualbasic/programming-guide/language-features/passing-named-arguments/module1.vb @@ -36,9 +36,9 @@ End Module ' Public Class StudentInfo - Shared Sub Display(ByVal name As String, - Optional ByVal age As Short = 0, - Optional ByVal birth As Date = #1/1/2000#) + Shared Sub Display(name As String, + Optional age As Short = 0, + Optional birth As Date = #1/1/2000#) Console.WriteLine($"Name = {name}; age = {age}; birth date = {birth:d}") End Sub diff --git a/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj b/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj index f2dee8c6bb7..e3a961b8ebd 100644 --- a/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj +++ b/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj @@ -5,12 +5,12 @@ netcoreapp3.0 CSWinFormDataGridView CSWinFormDataGridView - + true - false + true @@ -59,11 +59,11 @@ - - - - - + + + + + diff --git a/windowsforms/datagridview/CSWinFormDataGridView/Properties/AssemblyInfo.cs b/windowsforms/datagridview/CSWinFormDataGridView/Properties/AssemblyInfo.cs deleted file mode 100644 index 78113fd17fb..00000000000 --- a/windowsforms/datagridview/CSWinFormDataGridView/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CSWinFormDataGridView")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft Corporation")] -[assembly: AssemblyProduct("CSWinFormDataGridView")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("46fa4e76-c260-480e-b593-1dcbd6f15fc8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/windowsforms/graphics/WinFormGraphics_vb/MainForm.Designer.vb b/windowsforms/graphics/WinFormGraphics_vb/MainForm.Designer.vb index 095eb03d657..ac8f532831c 100644 --- a/windowsforms/graphics/WinFormGraphics_vb/MainForm.Designer.vb +++ b/windowsforms/graphics/WinFormGraphics_vb/MainForm.Designer.vb @@ -38,9 +38,9 @@ Namespace WinFormGraphics Me.label1 = New System.Windows.Forms.Label() Me.groupBox1.SuspendLayout() Me.SuspendLayout() - ' + ' ' groupBox1 - ' + ' Me.groupBox1.Controls.Add(Me.label8) Me.groupBox1.Controls.Add(Me.label7) Me.groupBox1.Controls.Add(Me.label6) @@ -57,88 +57,88 @@ Namespace WinFormGraphics Me.groupBox1.TabStop = False Me.groupBox1.Text = "Graphics" AddHandler Me.groupBox1.Paint, New System.Windows.Forms.PaintEventHandler(AddressOf Me.groupBox1_Paint) - ' + ' ' label8 - ' + ' Me.label8.AutoSize = True Me.label8.Location = New System.Drawing.Point(197, 312) Me.label8.Name = "label8" Me.label8.Size = New System.Drawing.Size(64, 16) Me.label8.TabIndex = 7 Me.label8.Text = "AntiAlias" - ' + ' ' label7 - ' + ' Me.label7.AutoSize = True Me.label7.Location = New System.Drawing.Point(62, 312) Me.label7.Name = "label7" Me.label7.Size = New System.Drawing.Size(41, 16) Me.label7.TabIndex = 6 Me.label7.Text = "None" - ' + ' ' label6 - ' + ' Me.label6.AutoSize = True Me.label6.Location = New System.Drawing.Point(31, 168) Me.label6.Name = "label6" Me.label6.Size = New System.Drawing.Size(119, 16) Me.label6.TabIndex = 5 Me.label6.Text = "2. Draw a curve." - ' + ' ' label5 - ' + ' Me.label5.AutoSize = True Me.label5.Location = New System.Drawing.Point(31, 354) Me.label5.Name = "label5" Me.label5.Size = New System.Drawing.Size(127, 16) Me.label5.TabIndex = 4 Me.label5.Text = "3. Draw an arrow." - ' + ' ' label4 - ' + ' Me.label4.AutoSize = True Me.label4.Location = New System.Drawing.Point(338, 226) Me.label4.Name = "label4" Me.label4.Size = New System.Drawing.Size(263, 16) Me.label4.TabIndex = 3 Me.label4.Text = "5. Draw an ellipse with gradient brush." - ' + ' ' label3 - ' + ' Me.label3.AutoSize = True Me.label3.Location = New System.Drawing.Point(338, 63) Me.label3.Name = "label3" Me.label3.Size = New System.Drawing.Size(173, 16) Me.label3.TabIndex = 2 Me.label3.Text = "4. Draw a vertical string." - ' + ' ' label2 - ' + ' Me.label2.AutoSize = True Me.label2.Location = New System.Drawing.Point(31, 63) Me.label2.Name = "label2" Me.label2.Size = New System.Drawing.Size(104, 16) Me.label2.TabIndex = 1 Me.label2.Text = "1. Draw a line." - ' + ' ' label1 - ' + ' Me.label1.Font = New System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte((0)))) Me.label1.Location = New System.Drawing.Point(31, 31) Me.label1.Name = "label1" Me.label1.Size = New System.Drawing.Size(648, 22) Me.label1.TabIndex = 0 Me.label1.Text = "This example demonstrates basic drawings in Windows Forms application." - ' + ' ' MainForm - ' + ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(730, 490) Me.Controls.Add(Me.groupBox1) Me.Name = "MainForm" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent - Me.Text = "CSWinFormGraphics" + Me.Text = "VBWinFormGraphics" Me.groupBox1.ResumeLayout(False) Me.groupBox1.PerformLayout() Me.ResumeLayout(False) diff --git a/winforms/formatting-utility/vb/Form1.vb b/winforms/formatting-utility/vb/Form1.vb index 3ce8bdbf329..e8c63f282eb 100644 --- a/winforms/formatting-utility/vb/Form1.vb +++ b/winforms/formatting-utility/vb/Form1.vb @@ -29,14 +29,14 @@ Public Class Form1 StatusBar.Items.AddRange(New ToolStripItem() {label}) ' Get localized strings for user interface. - Me.Text = rm.GetString("WindowCaption") - Me.ValueLabel.Text = rm.GetString(NameOf(ValueLabel)) - Me.FormatLabel.Text = rm.GetString(NameOf(FormatLabel)) - Me.ResultLabel.Text = rm.GetString(NameOf(ResultLabel)) - Me.CulturesLabel.Text = rm.GetString("CultureLabel") - Me.NumberBox.Text = rm.GetString("NumberBoxText") - Me.DateBox.Text = rm.GetString("DateBoxText") - Me.OKButton.Text = rm.GetString("OKButtonText") + Text = rm.GetString("WindowCaption") + ValueLabel.Text = rm.GetString(NameOf(ValueLabel)) + FormatLabel.Text = rm.GetString(NameOf(FormatLabel)) + ResultLabel.Text = rm.GetString(NameOf(ResultLabel)) + CulturesLabel.Text = rm.GetString("CultureLabel") + NumberBox.Text = rm.GetString("NumberBoxText") + DateBox.Text = rm.GetString("DateBoxText") + OKButton.Text = rm.GetString("OKButtonText") ' Populate CultureNames list box with culture names Dim cultures() As CultureInfo = CultureInfo.GetCultures(CultureTypes.AllCultures) @@ -51,7 +51,7 @@ Public Class Form1 ' Change the name of the invariant culture so it is human readable. names(0) = rm.GetString("InvariantCultureName") ' Add the culture names to the list box. - Me.CultureNames.Items.AddRange(names.ToArray()) + CultureNames.Items.AddRange(names.ToArray()) ' Make the current culture the selected culture. For ctr As Integer = 0 To names.Count - 1 @@ -60,7 +60,7 @@ Public Class Form1 Exit For End If Next - Me.CultureNames.SelectedIndex = currentIndex + CultureNames.SelectedIndex = currentIndex ' Get decimal separator. decimalSeparator = NumberFormatInfo.CurrentInfo.NumberDecimalSeparator @@ -82,45 +82,45 @@ Public Class Form1 pattern = $"^\s*\S+\s+\S+\s+\S+(\s+\S+)?(?= Int64.MinValue And bigintToFormat <= Int64.MaxValue Then + If bigintToFormat >= Long.MinValue And bigintToFormat <= Long.MaxValue Then intToFormat = CLng(bigintToFormat) Try - Me.Result.Text = intToFormat.ToString(Me.FormatStrings.Text, culture) + Result.Text = intToFormat.ToString(FormatStrings.Text, culture) Catch ex As FormatException label.Text = rm.GetString("MSG_InvalidFormat") - Me.formatInfo = True + formatInfo = True End Try Else ' Format a BigInteger Try - Me.Result.Text = bigintToFormat.ToString(Me.FormatStrings.Text, culture) + Result.Text = bigintToFormat.ToString(FormatStrings.Text, culture) Catch ex As Exception label.Text = rm.GetString("MSG_InvalidFormat") - Me.formatInfo = True + formatInfo = True End Try End If End If @@ -191,18 +192,18 @@ Public Class Form1 End If End Sub - Private Sub DateBox_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles DateBox.CheckedChanged - If Me.DateBox.Checked Then - Me.Result.Text = String.Empty + Private Sub DateBox_CheckedChanged(sender As Object, e As EventArgs) Handles DateBox.CheckedChanged + If DateBox.Checked Then + Result.Text = String.Empty - Me.FormatStrings.Items.Clear() - Me.FormatStrings.Items.AddRange(dateFormats) - Me.FormatStrings.SelectedIndex = DEFAULTSELECTION + FormatStrings.Items.Clear() + FormatStrings.Items.AddRange(dateFormats) + FormatStrings.SelectedIndex = DEFAULTSELECTION End If End Sub - Private Sub Value_TextChanged(sender As Object, e As System.EventArgs) Handles Value.TextChanged - Me.Result.Text = String.Empty + Private Sub Value_TextChanged(sender As Object, e As EventArgs) Handles Value.TextChanged + Result.Text = String.Empty If valueInfo Then label.Text = String.Empty @@ -211,15 +212,15 @@ Public Class Form1 OKButton.Enabled = Not String.IsNullOrEmpty(Value.Text) End Sub - Private Sub FormatStrings_SelectedValueChanged(sender As Object, e As System.EventArgs) Handles FormatStrings.SelectedValueChanged, CultureNames.SelectedValueChanged - Me.Result.Text = String.Empty + Private Sub FormatStrings_SelectedValueChanged(sender As Object, e As EventArgs) Handles FormatStrings.SelectedValueChanged, CultureNames.SelectedValueChanged + Result.Text = String.Empty If formatInfo Then label.Text = String.Empty formatInfo = False End If End Sub - Private Sub CultureNames_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CultureNames.SelectedIndexChanged - Me.Result.Text = String.Empty + Private Sub CultureNames_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CultureNames.SelectedIndexChanged + Result.Text = String.Empty End Sub End Class