Skip to content

Commit 13edf8e

Browse files
authored
Fix typos in property names and comments (#9441)
1 parent efedcfd commit 13edf8e

File tree

14 files changed

+73
-48
lines changed

14 files changed

+73
-48
lines changed

snippets/cpp/VS_Snippets_CLR/Type_GetProperty2/CPP/type_getproperty2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main()
3434
// Get the PropertyInfo by passing the property name and specifying the BindingFlags.
3535
PropertyInfo^ myPropInfo = myType->GetProperty( "MyProperty", static_cast<BindingFlags>(BindingFlags::Public | BindingFlags::Instance) );
3636

37-
// Display Name propety to console.
37+
// Display Name property to console.
3838
Console::WriteLine( "{0} is a property of MyClass.", myPropInfo->Name );
3939
}
4040
catch ( NullReferenceException^ e )

snippets/csharp/System.Windows.Input/CanExecuteRoutedEventArgs/Parameter/Window1.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ private void OnSliderMouseWheel(object sender, MouseWheelEventArgs e)
101101
if (e.Delta > 0)
102102
{
103103
//execute the Slider DecreaseSmall RoutedCommand
104-
//the slider.value propety is passed as the command parameter
104+
//the slider.value property is passed as the command parameter
105105
((RoutedCommand)Slider.DecreaseSmall).Execute(
106106
source.Value,source);
107107
}
108108
else
109109
{
110110
//execute the Slider IncreaseSmall RoutedCommand
111-
//the slider.value propety is passed as the command parameter
111+
//the slider.value property is passed as the command parameter
112112
((RoutedCommand)Slider.IncreaseSmall).Execute(
113113
source.Value,source);
114114
}
@@ -127,14 +127,14 @@ private void OnSliderMouseUp(object sender, MouseButtonEventArgs e)
127127
if (e.ChangedButton == MouseButton.XButton1)
128128
{
129129
// Execute the Slider DecreaseSmall RoutedCommand
130-
// The slider.value propety is passed as the command parameter
130+
// The slider.value property is passed as the command parameter
131131
((RoutedCommand)Slider.DecreaseSmall).Execute(
132132
source.Value, source);
133133
}
134134
if (e.ChangedButton == MouseButton.XButton2)
135135
{
136136
// Execute the Slider IncreaseSmall RoutedCommand
137-
// The slider.value propety is passed as the command parameter
137+
// The slider.value property is passed as the command parameter
138138
((RoutedCommand)Slider.IncreaseSmall).Execute(
139139
source.Value, source);
140140
}

snippets/csharp/System.Windows.Threading/Dispatcher/Invoke/Window1.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ private void OnSliderMouseWheel(object sender, MouseWheelEventArgs e)
103103
if (e.Delta > 0)
104104
{
105105
// Execute the Slider DecreaseSmall RoutedCommand.
106-
// The slider.value propety is passed as the command parameter.
106+
// The slider.value property is passed as the command parameter.
107107
((RoutedCommand)Slider.DecreaseSmall).Execute(
108108
source.Value, source);
109109
}
110110
else
111111
{
112112
// Execute the Slider IncreaseSmall RoutedCommand.
113-
// The slider.value propety is passed as the command parameter.
113+
// The slider.value property is passed as the command parameter.
114114
((RoutedCommand)Slider.IncreaseSmall).Execute(
115115
source.Value, source);
116116
}
@@ -127,14 +127,14 @@ private void OnSliderMouseUp(object sender, MouseButtonEventArgs e)
127127
if (e.ChangedButton == MouseButton.XButton1)
128128
{
129129
// Execute the Slider DecreaseSmall RoutedCommand.
130-
// The slider.value propety is passed as the command parameter.
130+
// The slider.value property is passed as the command parameter.
131131
((RoutedCommand)Slider.DecreaseSmall).Execute(
132132
source.Value, source);
133133
}
134134
if (e.ChangedButton == MouseButton.XButton2)
135135
{
136136
// Execute the Slider IncreaseSmall RoutedCommand.
137-
// The slider.value propety is passed as the command parameter.
137+
// The slider.value property is passed as the command parameter.
138138
((RoutedCommand)Slider.IncreaseSmall).Execute(
139139
source.Value, source);
140140
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
7+
</PropertyGroup>
8+
9+
</Project>

snippets/csharp/System/Type/GetProperty/type_getproperty1.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System;
44
using System.Reflection;
55

6-
class MyClass
6+
class MyClass1
77
{
88
private int myProperty;
99
// Declare MyProperty.
@@ -19,22 +19,23 @@ public int MyProperty
1919
}
2020
}
2121
}
22-
public class MyTypeClass
22+
23+
public class MyTypeClass2
2324
{
2425
public static void Main(string[] args)
2526
{
2627
try
2728
{
28-
// Get the Type object corresponding to MyClass.
29-
Type myType=typeof(MyClass);
29+
// Get the Type object corresponding to MyClass1.
30+
Type myType=typeof(MyClass1);
3031
// Get the PropertyInfo object by passing the property name.
3132
PropertyInfo myPropInfo = myType.GetProperty("MyProperty");
3233
// Display the property name.
33-
Console.WriteLine("The {0} property exists in MyClass.", myPropInfo.Name);
34+
Console.WriteLine("The {0} property exists in MyClass1.", myPropInfo.Name);
3435
}
3536
catch(NullReferenceException e)
3637
{
37-
Console.WriteLine("The property does not exist in MyClass." + e.Message);
38+
Console.WriteLine("The property does not exist in MyClass1." + e.Message);
3839
}
3940
}
4041
}

snippets/csharp/System/Type/GetProperty/type_getproperty2.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
using System;
44
using System.Reflection;
5-
class MyClass
5+
6+
class MyClass2
67
{
78
private int myProperty;
89
// Declare MyProperty.
@@ -18,22 +19,23 @@ public int MyProperty
1819
}
1920
}
2021
}
21-
public class MyTypeClass
22+
23+
public class MyTypeClass2
2224
{
2325
public static void Main(string[] args)
2426
{
2527
try
2628
{
27-
// Get Type object of MyClass.
28-
Type myType=typeof(MyClass);
29+
// Get Type object of MyClass2.
30+
Type myType=typeof(MyClass2);
2931
// Get the PropertyInfo by passing the property name and specifying the BindingFlags.
3032
PropertyInfo myPropInfo = myType.GetProperty("MyProperty", BindingFlags.Public | BindingFlags.Instance);
31-
// Display Name propety to console.
32-
Console.WriteLine("{0} is a property of MyClass.", myPropInfo.Name);
33+
// Display Name property to console.
34+
Console.WriteLine("{0} is a property of MyClass2.", myPropInfo.Name);
3335
}
3436
catch(NullReferenceException e)
3537
{
36-
Console.WriteLine("MyProperty does not exist in MyClass." +e.Message);
38+
Console.WriteLine("MyProperty does not exist in MyClass2." +e.Message);
3739
}
3840
}
3941
}

snippets/csharp/System/Type/GetProperty/type_getproperty21.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// <Snippet1>
22
using System;
33
using System.Reflection;
4+
45
public class MyPropertyClass
56
{
67
private int [,] myPropertyArray = new int[10,10];
@@ -17,6 +18,7 @@ public class MyPropertyClass
1718
}
1819
}
1920
}
21+
2022
public class MyTypeClass
2123
{
2224
public static void Main()

snippets/csharp/System/Type/GetProperty/type_getproperty3.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
using System;
44
using System.Reflection;
5-
class MyClass1
5+
6+
class MyClass3
67
{
78
private int [,] myArray = {{1,2},{3,4}};
89
// Declare an indexer.
@@ -18,22 +19,23 @@ class MyClass1
1819
}
1920
}
2021
}
21-
public class MyTypeClass
22+
23+
public class MyTypeClass3
2224
{
2325
public static void Main(string[] args)
2426
{
2527
try
2628
{
2729
// Get the Type object.
28-
Type myType=typeof(MyClass1);
30+
Type myType=typeof(MyClass3);
2931
Type[] myTypeArr = new Type[2];
3032
// Create an instance of a Type array.
3133
myTypeArr.SetValue(typeof(int),0);
3234
myTypeArr.SetValue(typeof(int),1);
3335
// Get the PropertyInfo object for the indexed property Item, which has two integer parameters.
3436
PropertyInfo myPropInfo = myType.GetProperty("Item", myTypeArr);
3537
// Display the property.
36-
Console.WriteLine("The {0} property exists in MyClass1.", myPropInfo.ToString());
38+
Console.WriteLine("The {0} property exists in MyClass3.", myPropInfo.ToString());
3739
}
3840
catch(NullReferenceException e)
3941
{

snippets/csharp/System/Type/GetProperty/type_getproperty_types.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
using System;
44
using System.Reflection;
55

6-
class MyClass1
6+
class MyPropertyTypeClass
77
{
8-
String myMessage="Hello World.";
8+
String myMessage = "Hello World.";
99
public string MyProperty1
1010
{
1111
get
@@ -14,39 +14,39 @@ public string MyProperty1
1414
}
1515
set
1616
{
17-
myMessage =value;
17+
myMessage = value;
1818
}
1919
}
2020
}
21+
2122
class TestClass
2223
{
2324
static void Main()
2425
{
2526
try
2627
{
27-
Type myType = typeof(MyClass1);
28+
Type myType = typeof(MyPropertyTypeClass);
2829
// Get the PropertyInfo object representing MyProperty1.
29-
PropertyInfo myStringProperties1 = myType.GetProperty("MyProperty1",
30-
typeof(string));
31-
Console.WriteLine("The name of the first property of MyClass1 is {0}.", myStringProperties1.Name);
32-
Console.WriteLine("The type of the first property of MyClass1 is {0}.", myStringProperties1.PropertyType);
30+
PropertyInfo myStringProperties1 = myType.GetProperty("MyProperty1", typeof(string));
31+
Console.WriteLine("The name of the first property of MyPropertyTypeClass is {0}.", myStringProperties1.Name);
32+
Console.WriteLine("The type of the first property of MyPropertyTypeClass is {0}.", myStringProperties1.PropertyType);
3333
}
3434
catch(ArgumentNullException e)
3535
{
36-
Console.WriteLine("ArgumentNullException :"+e.Message);
36+
Console.WriteLine("ArgumentNullException :" + e.Message);
3737
}
3838
catch(AmbiguousMatchException e)
3939
{
40-
Console.WriteLine("AmbiguousMatchException :"+e.Message);
40+
Console.WriteLine("AmbiguousMatchException :" + e.Message);
4141
}
4242
catch(NullReferenceException e)
4343
{
4444
Console.WriteLine("Source : {0}" , e.Source);
4545
Console.WriteLine("Message : {0}" , e.Message);
4646
}
4747
//Output:
48-
//The name of the first property of MyClass1 is MyProperty1.
49-
//The type of the first property of MyClass1 is System.String.
48+
//The name of the first property of MyPropertyTypeClass is MyProperty1.
49+
//The type of the first property of MyPropertyTypeClass is System.String.
5050
}
5151
}
5252
// </Snippet1>

snippets/fsharp/System/Type/GetProperty/type_getproperty2.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ try
1818
let myType = typeof<MyClass>
1919
// Get the PropertyInfo by passing the property name and specifying the BindingFlags.
2020
let myPropInfo = myType.GetProperty("MyProperty", BindingFlags.Public ||| BindingFlags.Instance)
21-
// Display Name propety to console.
21+
// Display Name property to console.
2222
printfn $"{myPropInfo.Name} is a property of MyClass."
2323
with :? NullReferenceException as e ->
2424
printfn $"MyProperty does not exist in MyClass.{e.Message}"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
7+
</PropertyGroup>
8+
9+
</Project>

snippets/visualbasic/VS_Snippets_CLR/Type_GetProperty1/VB/type_getproperty1.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Public Class MyTypeClass
2121
Dim myType As Type = GetType(MyClass1)
2222
' Get PropertyInfo object by passing property name.
2323
Dim myPropInfo As PropertyInfo = myType.GetProperty("MyProperty")
24-
' Display Name propety to console.
24+
' Display Name property to console.
2525
Console.WriteLine("The {0} property exists in MyClass.", myPropInfo.Name)
2626
Catch e As NullReferenceException
2727
Console.WriteLine("The property does not exist in MyClass.", e.Message.ToString())

snippets/visualbasic/VS_Snippets_Wpf/InvalidateRequeryWithDispatcherTimer/visualbasic/window1.xaml.vb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ Namespace SDKSamples
7979

8080
If e.Delta > 0 Then
8181
'execute the Slider DecreaseSmall RoutedCommand
82-
'the slider.value propety is passed as the command parameter
82+
'the slider.value property is passed as the command parameter
8383
CType(Slider.DecreaseSmall, RoutedCommand).Execute(source.Value,source)
8484

8585
Else
8686
'execute the Slider IncreaseSmall RoutedCommand
87-
'the slider.value propety is passed as the command parameter
87+
'the slider.value property is passed as the command parameter
8888
CType(Slider.IncreaseSmall, RoutedCommand).Execute(source.Value,source)
8989
End If
9090
End If
@@ -99,12 +99,12 @@ Namespace SDKSamples
9999
If source IsNot Nothing Then
100100
If e.ChangedButton = MouseButton.XButton1 Then
101101
' Execute the Slider DecreaseSmall RoutedCommand
102-
' The slider.value propety is passed as the command parameter
102+
' The slider.value property is passed as the command parameter
103103
CType(Slider.DecreaseSmall, RoutedCommand).Execute(source.Value, source)
104104
End If
105105
If e.ChangedButton = MouseButton.XButton2 Then
106106
' Execute the Slider IncreaseSmall RoutedCommand
107-
' The slider.value propety is passed as the command parameter
107+
' The slider.value property is passed as the command parameter
108108
CType(Slider.IncreaseSmall, RoutedCommand).Execute(source.Value, source)
109109
End If
110110
End If

snippets/visualbasic/VS_Snippets_Wpf/InvalidateRequeryWithSystemTimer/visualbasic/window1.xaml.vb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ Namespace SDKSamples
7878
If source IsNot Nothing Then
7979
If e.Delta > 0 Then
8080
' Execute the Slider DecreaseSmall RoutedCommand.
81-
' The slider.value propety is passed as the command parameter.
81+
' The slider.value property is passed as the command parameter.
8282
CType(Slider.DecreaseSmall, RoutedCommand).Execute(source.Value, source)
8383

8484
Else
8585
' Execute the Slider IncreaseSmall RoutedCommand.
86-
' The slider.value propety is passed as the command parameter.
86+
' The slider.value property is passed as the command parameter.
8787
CType(Slider.IncreaseSmall, RoutedCommand).Execute(source.Value, source)
8888
End If
8989
End If
@@ -96,12 +96,12 @@ Namespace SDKSamples
9696
If source IsNot Nothing Then
9797
If e.ChangedButton = MouseButton.XButton1 Then
9898
' Execute the Slider DecreaseSmall RoutedCommand.
99-
' The slider.value propety is passed as the command parameter.
99+
' The slider.value property is passed as the command parameter.
100100
CType(Slider.DecreaseSmall, RoutedCommand).Execute(source.Value, source)
101101
End If
102102
If e.ChangedButton = MouseButton.XButton2 Then
103103
' Execute the Slider IncreaseSmall RoutedCommand.
104-
' The slider.value propety is passed as the command parameter.
104+
' The slider.value property is passed as the command parameter.
105105
CType(Slider.IncreaseSmall, RoutedCommand).Execute(source.Value, source)
106106
End If
107107
End If

0 commit comments

Comments
 (0)