Skip to content

Commit a3733d8

Browse files
Names -> Keywords batch 5 (#6929)
* Names -> Keywords Replacing full type names with keywords when appropriate Files affected: source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs, source.cs. See #6920 * Example reverted * Example reverted
1 parent ad41401 commit a3733d8

File tree

19 files changed

+43
-43
lines changed
  • samples/snippets/csharp/VS_Snippets_CLR_Classic
    • classic DirectoryInfo.Name Example/CS
    • classic FieldAttributes Example/CS
    • classic MethodAttributes Example/CS
    • classic MethodBase.Attributes Example/CS
    • classic MethodRental.SwapMethodBody Example/CS
    • classic NumberFormatInfo.NumberNegativePattern Example/CS
    • classic ParameterInfo.IsOut Example/CS
    • classic ParameterInfo.Name Example/CS
    • classic ParameterInfo.ParameterType Example/CS
    • classic Queue.CopyTo Example/CS
    • classic Registry.ClassesRoot Example/CS
    • classic Registry.CurrentConfig Example/CS
    • classic Registry.CurrentUser Example/CS
    • classic Registry.DynData Example/CS
    • classic Registry.LocalMachine Example/CS
    • classic Registry.PerformanceData Example/CS
    • classic Registry.Users Example/CS
    • classic RegistryKey.GetValue Example/CS
    • classic ResourceWriter Example/CS

19 files changed

+43
-43
lines changed

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DirectoryInfo.Name Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.IO;
44

@@ -7,7 +7,7 @@ class GetAName
77
public static void Main(string[] args)
88
{
99
DirectoryInfo dir = new DirectoryInfo(".");
10-
String dirName=dir.Name;
10+
string dirName=dir.Name;
1111
Console.WriteLine("DirectoryInfo name is {0}.", dirName);
1212
}
1313
}

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldAttributes Example/CS/source.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Reflection;
44

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodAttributes Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Reflection;
44

@@ -37,7 +37,7 @@ public static void PrintAttributes(Type attribType, int iAttribValue)
3737
FieldInfo[] fields = attribType.GetFields(BindingFlags.Public | BindingFlags.Static);
3838
for (int i = 0; i < fields.Length; i++)
3939
{
40-
int fieldvalue = (Int32)fields[i].GetValue(null);
40+
int fieldvalue = (int)fields[i].GetValue(null);
4141
if ((fieldvalue & iAttribValue) == fieldvalue)
4242
{
4343
Console.WriteLine(fields[i].Name);

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Attributes Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//<Snippet1>
1+
//<Snippet1>
22

33
using System;
44
using System.Reflection;
@@ -42,7 +42,7 @@ public static void PrintAttributes(Type attribType, int iAttribValue)
4242
FieldInfo[] fields = attribType.GetFields(BindingFlags.Public | BindingFlags.Static);
4343
for (int i = 0; i < fields.Length; i++)
4444
{
45-
int fieldvalue = (Int32)fields[i].GetValue(null);
45+
int fieldvalue = (int)fields[i].GetValue(null);
4646
if ((fieldvalue & iAttribValue) == fieldvalue)
4747
{
4848
Console.WriteLine(fields[i].Name);

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodRental.SwapMethodBody Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Reflection;
44
using System.Reflection.Emit;
@@ -8,7 +8,7 @@ class SwapMethodBodySample
88
{
99
// First make a method that returns 0.
1010
// Then swap the method body with a body that returns 1.
11-
public static void Main(String [] args)
11+
public static void Main(string [] args)
1212
{
1313
// Construct a dynamic assembly
1414
Guid g = Guid.NewGuid();

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberNegativePattern Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Globalization;
44

@@ -20,7 +20,7 @@ public static void Main() {
2020
for (int i = 0; i <= 4; i++) {
2121
nfi.NumberNegativePattern = i;
2222
Console.WriteLine("{0,-20} {1,-10}",
23-
String.Format("Pattern {0}:",
23+
string.Format("Pattern {0}:",
2424
nfi.NumberNegativePattern),
2525
value.ToString("N", nfi));
2626
}

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.IsOut Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Reflection;
44

@@ -40,7 +40,7 @@ public static int Main(string[] args)
4040
4141
Reflection.ParameterInfo
4242
43-
Mymethodbase = Void mymethod (Int32, System.String ByRef, System.String ByRef)
43+
Mymethodbase = Void mymethod (int, System.String ByRef, System.String ByRef)
4444
For parameter # 0, the IsOut is - False
4545
For parameter # 1, the IsOut is - True
4646
For parameter # 2, the IsOut is - False

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.Name Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Reflection;
44

@@ -41,7 +41,7 @@ public static int Main(string[] args)
4141
Reflection.ParameterInfo
4242
4343
Mymethodbase
44-
= Void mymethod (Int32, System.String ByRef, System.String ByRef)
44+
= Void mymethod (int, System.String ByRef, System.String ByRef)
4545
For parameter # 0, the Name is - int1m
4646
For parameter # 1, the Name is - str2m
4747
For parameter # 2, the Name is - str3m

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.ParameterType Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Reflection;
44

@@ -41,7 +41,7 @@ public static int Main(string[] args)
4141
4242
Reflection.Parameterinfo
4343
44-
Mymethodbase = Void mymethod(Int32, System.String ByRef, System.String ByRef)
44+
Mymethodbase = Void mymethod(int, System.String ByRef, System.String ByRef)
4545
For parameter # 0, the ParameterType is - System.Int32
4646
For parameter # 1, the ParameterType is - System.String&
4747
For parameter # 2, the ParameterType is - System.String&

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.CopyTo Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Collections;
44
public class SamplesQueue {
@@ -15,7 +15,7 @@ public static void Main() {
1515
mySourceQ.Enqueue( "barn" );
1616

1717
// Creates and initializes the one-dimensional target Array.
18-
Array myTargetArray=Array.CreateInstance( typeof(String), 15 );
18+
Array myTargetArray=Array.CreateInstance( typeof(string), 15 );
1919
myTargetArray.SetValue( "The", 0 );
2020
myTargetArray.SetValue( "quick", 1 );
2121
myTargetArray.SetValue( "brown", 2 );

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.ClassesRoot Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,15 +16,15 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names = rkey.GetSubKeyNames();
19+
string [] names = rkey.GetSubKeyNames();
2020

2121
int icount = 0;
2222

2323
Console.WriteLine("Subkeys of " + rkey.Name);
2424
Console.WriteLine("-----------------------------------------------");
2525

2626
// Print the contents of the array to the console.
27-
foreach (String s in names) {
27+
foreach (string s in names) {
2828
Console.WriteLine(s);
2929

3030
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.CurrentConfig Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,15 +16,15 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names = rkey.GetSubKeyNames();
19+
string [] names = rkey.GetSubKeyNames();
2020

2121
int icount = 0;
2222

2323
Console.WriteLine("Subkeys of " + rkey.Name);
2424
Console.WriteLine("-----------------------------------------------");
2525

2626
// Print the contents of the array to the console.
27-
foreach (String s in names) {
27+
foreach (string s in names) {
2828
Console.WriteLine(s);
2929

3030
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.CurrentUser Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,15 +16,15 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names = rkey.GetSubKeyNames();
19+
string [] names = rkey.GetSubKeyNames();
2020

2121
int icount = 0;
2222

2323
Console.WriteLine("Subkeys of " + rkey.Name);
2424
Console.WriteLine("-----------------------------------------------");
2525

2626
// Print the contents of the array to the console.
27-
foreach (String s in names) {
27+
foreach (string s in names) {
2828
Console.WriteLine(s);
2929

3030
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.DynData Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,7 +16,7 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names;
19+
string [] names;
2020
try {
2121
names = rkey.GetSubKeyNames();
2222
}
@@ -31,7 +31,7 @@ static void PrintKeys(RegistryKey rkey) {
3131
Console.WriteLine("-----------------------------------------------");
3232

3333
// Print the contents of the array to the console.
34-
foreach (String s in names) {
34+
foreach (string s in names) {
3535
Console.WriteLine(s);
3636

3737
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.LocalMachine Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,15 +16,15 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names = rkey.GetSubKeyNames();
19+
string [] names = rkey.GetSubKeyNames();
2020

2121
int icount = 0;
2222

2323
Console.WriteLine("Subkeys of " + rkey.Name);
2424
Console.WriteLine("-----------------------------------------------");
2525

2626
// Print the contents of the array to the console.
27-
foreach (String s in names) {
27+
foreach (string s in names) {
2828
Console.WriteLine(s);
2929

3030
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.PerformanceData Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,15 +16,15 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names = rkey.GetSubKeyNames();
19+
string [] names = rkey.GetSubKeyNames();
2020

2121
int icount = 0;
2222

2323
Console.WriteLine("Subkeys of " + rkey.Name);
2424
Console.WriteLine("-----------------------------------------------");
2525

2626
// Print the contents of the array to the console.
27-
foreach (String s in names) {
27+
foreach (string s in names) {
2828
Console.WriteLine(s);
2929

3030
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.Users Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -16,15 +16,15 @@ public static void Main() {
1616
static void PrintKeys(RegistryKey rkey) {
1717

1818
// Retrieve all the subkeys for the specified key.
19-
String [] names = rkey.GetSubKeyNames();
19+
string [] names = rkey.GetSubKeyNames();
2020

2121
int icount = 0;
2222

2323
Console.WriteLine("Subkeys of " + rkey.Name);
2424
Console.WriteLine("-----------------------------------------------");
2525

2626
// Print the contents of the array to the console.
27-
foreach (String s in names) {
27+
foreach (string s in names) {
2828
Console.WriteLine(s);
2929

3030
// The following code puts a limit on the number

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic RegistryKey.GetValue Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using Microsoft.Win32;
44

@@ -33,7 +33,7 @@ public static void Main()
3333
Console.WriteLine();
3434
break;
3535
case RegistryValueKind.DWord:
36-
Console.WriteLine("Value = " + Convert.ToString((Int32)o));
36+
Console.WriteLine("Value = " + Convert.ToString((int)o));
3737
break;
3838
case RegistryValueKind.QWord:
3939
Console.WriteLine("Value = " + Convert.ToString((Int64)o));

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ResourceWriter Example/CS/source.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Resources;
44

0 commit comments

Comments
 (0)