Skip to content

Commit ad41401

Browse files
Names -> Keywords (#6928)
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, source.cs. See #6920
1 parent bb7dd3c commit ad41401

File tree

20 files changed

+49
-49
lines changed
  • samples/snippets/csharp/VS_Snippets_CLR_Classic

20 files changed

+49
-49
lines changed

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.BinarySearch1 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 System.Collections;
44
public class SamplesArrayList {
@@ -12,7 +12,7 @@ public static void Main() {
1212
myAL.Add( i*2 );
1313

1414
// Displays the ArrayList.
15-
Console.WriteLine( "The Int32 ArrayList contains the following:" );
15+
Console.WriteLine( "The int ArrayList contains the following:" );
1616
PrintValues( myAL );
1717

1818
// Locates a specific object that does not exist in the ArrayList.
@@ -41,7 +41,7 @@ public static void PrintValues( IEnumerable myList ) {
4141
/*
4242
This code produces the following output.
4343
44-
The Int32 ArrayList contains the following:
44+
The int ArrayList contains the following:
4545
0 2 4 6 8
4646
The object to search for (3) is not found. The next larger object is at index 2.
4747
The object to search for (6) is at index 3.

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IndexOf 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 SamplesArrayList
@@ -27,7 +27,7 @@ public static void Main()
2727
PrintIndexAndValues( myAL );
2828

2929
// Search for the first occurrence of the duplicated value.
30-
String myString = "the";
30+
string myString = "the";
3131
int myIndex = myAL.IndexOf( myString );
3232
Console.WriteLine( "The first occurrence of \"{0}\" is at index {1}.", myString, myIndex );
3333

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Insert 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 SamplesArrayList {
@@ -75,7 +75,7 @@ The quick brown fox jumps over the lazy dog
7575
The quick brown fox jumps over the lazy dog !!!
7676
Exception: System.ArgumentOutOfRangeException: Insertion index was out of range. Must be non-negative and less than or equal to size.
7777
Parameter name: index
78-
at System.Collections.ArrayList.Insert(Int32 index, Object value)
78+
at System.Collections.ArrayList.Insert(int index, Object value)
7979
at SamplesArrayList.Main()
8080
*/
8181

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsFixedSize 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 SamplesArrayList {
@@ -105,7 +105,7 @@ This code produces the following output.
105105
at System.Collections.FixedSizeArrayList.Add(Object obj)
106106
at SamplesArrayList.Main()
107107
Exception: System.NotSupportedException: Collection was of a fixed size.
108-
at System.Collections.FixedSizeArrayList.Insert(Int32 index, Object obj)
108+
at System.Collections.FixedSizeArrayList.Insert(int index, Object obj)
109109
at SamplesArrayList.Main()
110110
111111
*/

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.LastIndexOf 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 SamplesArrayList {
@@ -25,7 +25,7 @@ public static void Main() {
2525
PrintIndexAndValues( myAL );
2626

2727
// Searches for the last occurrence of the duplicated value.
28-
String myString = "the";
28+
string myString = "the";
2929
int myIndex = myAL.LastIndexOf( myString );
3030
Console.WriteLine( "The last occurrence of \"{0}\" is at index {1}.", myString, myIndex );
3131

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.ReadOnly1 Example/CS/source.cs

Lines changed: 5 additions & 5 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 SamplesArrayList {
@@ -21,10 +21,10 @@ public static void Main() {
2121
// Displays the contents of both collections.
2222
Console.WriteLine( "\nInitially," );
2323
Console.WriteLine( "The original ArrayList myAL contains:" );
24-
foreach ( String myStr in myAL )
24+
foreach ( string myStr in myAL )
2525
Console.WriteLine( " {0}", myStr );
2626
Console.WriteLine( "The read-only ArrayList myReadOnlyAL contains:" );
27-
foreach ( String myStr in myReadOnlyAL )
27+
foreach ( string myStr in myReadOnlyAL )
2828
Console.WriteLine( " {0}", myStr );
2929

3030
// Adding an element to a read-only ArrayList throws an exception.
@@ -41,10 +41,10 @@ public static void Main() {
4141
// Displays the contents of both collections again.
4242
Console.WriteLine( "\nAfter adding a new element to the original ArrayList," );
4343
Console.WriteLine( "The original ArrayList myAL contains:" );
44-
foreach ( String myStr in myAL )
44+
foreach ( string myStr in myAL )
4545
Console.WriteLine( " {0}", myStr );
4646
Console.WriteLine( "The read-only ArrayList myReadOnlyAL contains:" );
47-
foreach ( String myStr in myReadOnlyAL )
47+
foreach ( string myStr in myReadOnlyAL )
4848
Console.WriteLine( " {0}", myStr );
4949
}
5050
}

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo 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 System.Collections;
44
public class SamplesBitArray {
@@ -56,7 +56,7 @@ public static void Main() {
5656

5757
// Returns an exception if the array is not of type Boolean, integer or byte.
5858
try {
59-
Array myStringArray=Array.CreateInstance( typeof(String), 8 );
59+
Array myStringArray=Array.CreateInstance( typeof(string), 8 );
6060
myStringArray.SetValue( "Hello", 0 );
6161
myStringArray.SetValue( "World", 1 );
6262
myBA.CopyTo( myStringArray, 3 );
@@ -87,7 +87,7 @@ The target byte Array contains the following (before and after copying):
8787
10 11 0 0 0 0 0 0
8888
10 11 0 15 0 0 0 0
8989
Exception: System.ArgumentException: Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[].
90-
at System.Collections.BitArray.CopyTo(Array array, Int32 index)
90+
at System.Collections.BitArray.CopyTo(Array array, int index)
9191
at SamplesBitArray.Main()
9292
9393
*/

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Console 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

44
public class Example {
@@ -7,7 +7,7 @@ public static void Main()
77
Console.Write("Hello ");
88
Console.WriteLine("World!");
99
Console.Write("Enter your name: ");
10-
String name = Console.ReadLine();
10+
string name = Console.ReadLine();
1111
Console.Write("Good day, ");
1212
Console.Write(name);
1313
Console.WriteLine("!");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using System.ComponentModel;
44
using System.Security.Cryptography;
55

66
public class Sample
77
{
88
// <Snippet1>
9-
private static void EncryptData(String inName, String outName, byte[] aesKey, byte[] aesIV)
9+
private static void EncryptData(string inName, string outName, byte[] aesKey, byte[] aesIV)
1010
{
1111
//Create the file streams to handle the input and output files.
1212
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using System.Windows.Forms;
44
using System.Security.Cryptography;
55

66
public class Form1: Form
77
{
88
// <Snippet1>
9-
private static void EncryptData(String inName, String outName, byte[] desKey, byte[] desIV)
9+
private static void EncryptData(string inName, string outName, byte[] desKey, byte[] desIV)
1010
{
1111
//Create the file streams to handle the input and output files.
1212
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTime.ToString2 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 System.Globalization;
44

@@ -21,10 +21,10 @@ public static void Main(string[] args) {
2121
"M/yy",
2222
"dd-MM-yy",
2323
};
24-
String date;
24+
string date;
2525
for (int i = 0; i < format.Length; i++) {
2626
date = dt.ToString(format[i], DateTimeFormatInfo.InvariantInfo);
27-
Console.WriteLine(String.Concat(format[i], " :" , date));
27+
Console.WriteLine(string.Concat(format[i], " :" , date));
2828
}
2929

3030
/** Output.

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTimeFormatInfo.GetAllDateTimePatterns 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
public class SamplesDateTimeFormatInfo {
@@ -41,7 +41,7 @@ public static void Main() {
4141

4242
public static void PrintIndexAndValues( String[] myArray ) {
4343
int i = 0;
44-
foreach ( String s in myArray )
44+
foreach ( string s in myArray )
4545
Console.WriteLine( "\t[{0}]:\t{1}", i++, s );
4646
Console.WriteLine();
4747
}

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Write Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(Object myObject, String category) {
14+
static public void MyErrorMethod(Object myObject, string category) {
1515
// Write the message if the TraceSwitch level is set to Error or higher.
1616
if(generalSwitch.TraceError)
1717
Debug.Write(myObject, category);

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf2 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(Object myObject, String category) {
14+
static public void MyErrorMethod(Object myObject, string category) {
1515
// Write the message if the TraceSwitch level is set to Verbose.
1616
Debug.WriteIf(generalSwitch.TraceVerbose, myObject.ToString() +
1717
" is not a valid object for category: ", category);

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf3 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(Object myObject, String category) {
14+
static public void MyErrorMethod(Object myObject, string category) {
1515
// Write the message if the TraceSwitch level is set to Verbose.
1616
Debug.WriteIf(generalSwitch.TraceVerbose, myObject, category);
1717

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine2 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(String category) {
14+
static public void MyErrorMethod(string category) {
1515
// Write the message if the TraceSwitch level is set to Error or higher.
1616
if(generalSwitch.TraceError)
1717
Debug.Write("My error message. ");

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine3 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(Object myObject, String category) {
14+
static public void MyErrorMethod(Object myObject, string category) {
1515
// Write the message if the TraceSwitch level is set to Error or higher.
1616
if(generalSwitch.TraceError)
1717
Debug.Write("Invalid object for category. ");

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf2 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(String category) {
14+
static public void MyErrorMethod(string category) {
1515
// Write the message if the TraceSwitch level is set to Error or higher.
1616
Debug.WriteIf(generalSwitch.TraceError, "My error message. ");
1717

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf3 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Diagnostics;
44
using System.Windows.Forms;
@@ -11,7 +11,7 @@ public class Form1: Form
1111
// Create a TraceSwitch.
1212
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1313

14-
static public void MyErrorMethod(Object myObject, String category) {
14+
static public void MyErrorMethod(Object myObject, string category) {
1515
// Write the message if the TraceSwitch level is set to Error or higher.
1616
Debug.WriteIf(generalSwitch.TraceError, "Invalid object for category. ");
1717

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
public class SamplesDelegate {
44

5-
// Declares a delegate for a method that takes in an int and returns a String.
6-
public delegate String myMethodDelegate( int myInt );
5+
// Declares a delegate for a method that takes in an int and returns a string.
6+
public delegate string myMethodDelegate( int myInt );
77

88
// Defines some methods to which the delegate can point.
99
public class mySampleClass {
1010

1111
// Defines an instance method.
12-
public String myStringMethod ( int myInt ) {
12+
public string myStringMethod ( int myInt ) {
1313
if ( myInt > 0 )
1414
return( "positive" );
1515
if ( myInt < 0 )
@@ -18,7 +18,7 @@ public String myStringMethod ( int myInt ) {
1818
}
1919

2020
// Defines a static method.
21-
public static String mySignMethod ( int myInt ) {
21+
public static string mySignMethod ( int myInt ) {
2222
if ( myInt > 0 )
2323
return( "+" );
2424
if ( myInt < 0 )

0 commit comments

Comments
 (0)