Skip to content

Commit 5beded2

Browse files
authored
Fix variable names in 'Viewing Type Information' article (dotnet#24102)
Fixes dotnet#23868
1 parent aa0b60a commit 5beded2

File tree

6 files changed

+55
-55
lines changed

6 files changed

+55
-55
lines changed

samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source2.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ using namespace System;
33
using namespace System::IO;
44
using namespace System::Reflection;
55

6-
public ref class Mymemberinfo
6+
public ref class MyMemberInfo
77
{
88
public:
99
static void Main()
1010
{
1111
Console::WriteLine ("\nReflection.MemberInfo");
1212
// Gets the Type and MemberInfo.
13-
Type^ MyType = Type::GetType("System.IO.File");
14-
array<MemberInfo^>^ Mymemberinfoarray = MyType->GetMembers();
13+
Type^ myType = Type::GetType("System.IO.File");
14+
array<MemberInfo^>^ myMemberInfoArray = myType->GetMembers();
1515
// Gets and displays the DeclaringType method.
1616
Console::WriteLine("\nThere are {0} members in {1}.",
17-
Mymemberinfoarray->Length, MyType->FullName);
18-
Console::WriteLine("{0}.", MyType->FullName);
19-
if (MyType->IsPublic)
17+
myMemberInfoArray->Length, myType->FullName);
18+
Console::WriteLine("{0}.", myType->FullName);
19+
if (myType->IsPublic)
2020
{
21-
Console::WriteLine("{0} is public.", MyType->FullName);
21+
Console::WriteLine("{0} is public.", myType->FullName);
2222
}
2323
}
2424
};
2525

2626
int main()
2727
{
28-
Mymemberinfo::Main();
28+
MyMemberInfo::Main();
2929
}
3030
// </snippet2>

samples/snippets/cpp/VS_Snippets_CLR/conceptual.types.viewinfo/cpp/source3.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@ public ref class MyMethodInfo
1010
{
1111
Console::WriteLine("Reflection.MethodInfo");
1212
// Gets and displays the Type.
13-
Type^ MyType = Type::GetType("System.Reflection.FieldInfo");
13+
Type^ myType = Type::GetType("System.Reflection.FieldInfo");
1414
// Specifies the member for which you want type information.
15-
MethodInfo^ Mymethodinfo = MyType->GetMethod("GetValue");
16-
Console::WriteLine(MyType->FullName + "." + Mymethodinfo->Name);
15+
MethodInfo^ myMethodInfo = myType->GetMethod("GetValue");
16+
Console::WriteLine(myType->FullName + "." + myMethodInfo->Name);
1717
// Gets and displays the MemberType property.
18-
MemberTypes Mymembertypes = Mymethodinfo->MemberType;
19-
if (MemberTypes::Constructor == Mymembertypes)
18+
MemberTypes myMemberTypes = myMethodInfo->MemberType;
19+
if (MemberTypes::Constructor == myMemberTypes)
2020
{
2121
Console::WriteLine("MemberType is of type All");
2222
}
23-
else if (MemberTypes::Custom == Mymembertypes)
23+
else if (MemberTypes::Custom == myMemberTypes)
2424
{
2525
Console::WriteLine("MemberType is of type Custom");
2626
}
27-
else if (MemberTypes::Event == Mymembertypes)
27+
else if (MemberTypes::Event == myMemberTypes)
2828
{
2929
Console::WriteLine("MemberType is of type Event");
3030
}
31-
else if (MemberTypes::Field == Mymembertypes)
31+
else if (MemberTypes::Field == myMemberTypes)
3232
{
3333
Console::WriteLine("MemberType is of type Field");
3434
}
35-
else if (MemberTypes::Method == Mymembertypes)
35+
else if (MemberTypes::Method == myMemberTypes)
3636
{
3737
Console::WriteLine("MemberType is of type Method");
3838
}
39-
else if (MemberTypes::Property == Mymembertypes)
39+
else if (MemberTypes::Property == myMemberTypes)
4040
{
4141
Console::WriteLine("MemberType is of type Property");
4242
}
43-
else if (MemberTypes::TypeInfo == Mymembertypes)
43+
else if (MemberTypes::TypeInfo == myMemberTypes)
4444
{
4545
Console::WriteLine("MemberType is of type TypeInfo");
4646
}

samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source2.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
using System.IO;
44
using System.Reflection;
55

6-
class Mymemberinfo
6+
class MyMemberInfo
77
{
88
public static void Main()
99
{
1010
Console.WriteLine ("\nReflection.MemberInfo");
1111
// Gets the Type and MemberInfo.
12-
Type MyType = Type.GetType("System.IO.File");
13-
MemberInfo[] Mymemberinfoarray = MyType.GetMembers();
12+
Type myType = Type.GetType("System.IO.File");
13+
MemberInfo[] myMemberInfoArray = myType.GetMembers();
1414
// Gets and displays the DeclaringType method.
1515
Console.WriteLine("\nThere are {0} members in {1}.",
16-
Mymemberinfoarray.Length, MyType.FullName);
17-
Console.WriteLine("{0}.", MyType.FullName);
18-
if (MyType.IsPublic)
16+
myMemberInfoArray.Length, myType.FullName);
17+
Console.WriteLine("{0}.", myType.FullName);
18+
if (myType.IsPublic)
1919
{
20-
Console.WriteLine("{0} is public.", MyType.FullName);
20+
Console.WriteLine("{0} is public.", myType.FullName);
2121
}
2222
}
2323
}

samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.viewinfo/cs/source3.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@ public static int Main()
99
{
1010
Console.WriteLine("Reflection.MethodInfo");
1111
// Gets and displays the Type.
12-
Type MyType = Type.GetType("System.Reflection.FieldInfo");
12+
Type myType = Type.GetType("System.Reflection.FieldInfo");
1313
// Specifies the member for which you want type information.
14-
MethodInfo Mymethodinfo = MyType.GetMethod("GetValue");
15-
Console.WriteLine(MyType.FullName + "." + Mymethodinfo.Name);
14+
MethodInfo myMethodInfo = myType.GetMethod("GetValue");
15+
Console.WriteLine(myType.FullName + "." + myMethodInfo.Name);
1616
// Gets and displays the MemberType property.
17-
MemberTypes Mymembertypes = Mymethodinfo.MemberType;
18-
if (MemberTypes.Constructor == Mymembertypes)
17+
MemberTypes myMemberTypes = myMethodInfo.MemberType;
18+
if (MemberTypes.Constructor == myMemberTypes)
1919
{
2020
Console.WriteLine("MemberType is of type All");
2121
}
22-
else if (MemberTypes.Custom == Mymembertypes)
22+
else if (MemberTypes.Custom == myMemberTypes)
2323
{
2424
Console.WriteLine("MemberType is of type Custom");
2525
}
26-
else if (MemberTypes.Event == Mymembertypes)
26+
else if (MemberTypes.Event == myMemberTypes)
2727
{
2828
Console.WriteLine("MemberType is of type Event");
2929
}
30-
else if (MemberTypes.Field == Mymembertypes)
30+
else if (MemberTypes.Field == myMemberTypes)
3131
{
3232
Console.WriteLine("MemberType is of type Field");
3333
}
34-
else if (MemberTypes.Method == Mymembertypes)
34+
else if (MemberTypes.Method == myMemberTypes)
3535
{
3636
Console.WriteLine("MemberType is of type Method");
3737
}
38-
else if (MemberTypes.Property == Mymembertypes)
38+
else if (MemberTypes.Property == myMemberTypes)
3939
{
4040
Console.WriteLine("MemberType is of type Property");
4141
}
42-
else if (MemberTypes.TypeInfo == Mymembertypes)
42+
else if (MemberTypes.TypeInfo == myMemberTypes)
4343
{
4444
Console.WriteLine("MemberType is of type TypeInfo");
4545
}

samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source2.vb

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
Imports System.IO
33
Imports System.Reflection
44

5-
Class Mymemberinfo
5+
Class MyMemberInfo
66
Public Shared Sub Main()
77
Console.WriteLine("\nReflection.MemberInfo")
88
' Gets the Type and MemberInfo.
9-
Dim MyType As Type = Type.GetType("System.IO.File")
10-
Dim Mymemberinfoarray() As MemberInfo = MyType.GetMembers()
9+
Dim myType As Type = Type.GetType("System.IO.File")
10+
Dim myMemberInfoArray() As MemberInfo = myType.GetMembers()
1111
' Gets and displays the DeclaringType method.
1212
Console.WriteLine("\nThere are {0} members in {1}.",
13-
Mymemberinfoarray.Length, MyType.FullName)
14-
Console.WriteLine("{0}.", MyType.FullName)
15-
If MyType.IsPublic
16-
Console.WriteLine("{0} is public.", MyType.FullName)
13+
myMemberInfoArray.Length, myType.FullName)
14+
Console.WriteLine("{0}.", myType.FullName)
15+
If myType.IsPublic
16+
Console.WriteLine("{0} is public.", myType.FullName)
1717
End If
1818
End Sub
1919
End Class

samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.viewinfo/vb/source3.vb

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ Class MyMethodInfo
55
Public Shared Sub Main()
66
Console.WriteLine("Reflection.MethodInfo")
77
' Gets and displays the Type.
8-
Dim MyType As Type = Type.GetType("System.Reflection.FieldInfo")
8+
Dim myType As Type = Type.GetType("System.Reflection.FieldInfo")
99
' Specifies the member for which you want type information.
10-
Dim Mymethodinfo As MethodInfo = MyType.GetMethod("GetValue")
11-
Console.WriteLine((MyType.FullName & "." & Mymethodinfo.Name))
10+
Dim myMethodInfo As MethodInfo = myType.GetMethod("GetValue")
11+
Console.WriteLine((myType.FullName & "." & myMethodInfo.Name))
1212
' Gets and displays the MemberType property.
13-
Dim Mymembertypes As MemberTypes = Mymethodinfo.MemberType
14-
If MemberTypes.Constructor = Mymembertypes Then
13+
Dim myMemberTypes As MemberTypes = myMethodInfo.MemberType
14+
If MemberTypes.Constructor = myMemberTypes Then
1515
Console.WriteLine("MemberType is of type All")
16-
ElseIf MemberTypes.Custom = Mymembertypes Then
16+
ElseIf MemberTypes.Custom = myMemberTypes Then
1717
Console.WriteLine("MemberType is of type Custom")
18-
ElseIf MemberTypes.Event = Mymembertypes Then
18+
ElseIf MemberTypes.Event = myMemberTypes Then
1919
Console.WriteLine("MemberType is of type Event")
20-
ElseIf MemberTypes.Field = Mymembertypes Then
20+
ElseIf MemberTypes.Field = myMemberTypes Then
2121
Console.WriteLine("MemberType is of type Field")
22-
ElseIf MemberTypes.Method = Mymembertypes Then
22+
ElseIf MemberTypes.Method = myMemberTypes Then
2323
Console.WriteLine("MemberType is of type Method")
24-
ElseIf MemberTypes.Property = Mymembertypes Then
24+
ElseIf MemberTypes.Property = myMemberTypes Then
2525
Console.WriteLine("MemberType is of type Property")
26-
ElseIf MemberTypes.TypeInfo = Mymembertypes Then
26+
ElseIf MemberTypes.TypeInfo = myMemberTypes Then
2727
Console.WriteLine("MemberType is of type TypeInfo")
2828
End If
2929
Return

0 commit comments

Comments
 (0)