Skip to content

Commit 872ec1e

Browse files
Names -> Keywords (#6930)
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, action.cs, Action3.cs, Anon.cs, Delegate.cs, Lambda.cs, Action4.cs. See #6920
1 parent a3733d8 commit 872ec1e

File tree

24 files changed

+43
-43
lines changed

24 files changed

+43
-43
lines changed

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Contains 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

@@ -25,7 +25,7 @@ public static void Main() {
2525
Console.WriteLine( "The key \"{0}\" is {1}.", myKey, mySL.ContainsKey( myKey ) ? "in the SortedList" : "NOT in the SortedList" );
2626

2727
// Searches for a specific value.
28-
String myValue = "three";
28+
string myValue = "three";
2929
Console.WriteLine( "The value \"{0}\" is {1}.", myValue, mySL.ContainsValue( myValue ) ? "in the SortedList" : "NOT in the SortedList" );
3030
myValue = "nine";
3131
Console.WriteLine( "The value \"{0}\" is {1}.", myValue, mySL.ContainsValue( myValue ) ? "in the SortedList" : "NOT in the SortedList" );

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.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 SamplesSortedList {
@@ -18,7 +18,7 @@ public static void Main() {
1818
String[] tempArray = new String[] { "The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" };
1919
DictionaryEntry[] myTargetArray = new DictionaryEntry[15];
2020
int i = 0;
21-
foreach ( String s in tempArray ) {
21+
foreach ( string s in tempArray ) {
2222
myTargetArray[i].Key = i;
2323
myTargetArray[i].Value = s;
2424
i++;

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IndexOfKey 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 SamplesSortedList {
@@ -22,7 +22,7 @@ public static void Main() {
2222
Console.WriteLine( "The key \"{0}\" is at index {1}.", myKey, mySL.IndexOfKey( myKey ) );
2323

2424
// Searches for a specific value.
25-
String myValue = "three";
25+
string myValue = "three";
2626
Console.WriteLine( "The value \"{0}\" is at index {1}.", myValue, mySL.IndexOfValue( myValue ) );
2727
}
2828

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.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 SamplesStack {
@@ -15,7 +15,7 @@ public static void Main() {
1515
mySourceQ.Push( "three" );
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 String.Substring1 Example/CS/source.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using System;
1+
using System;
22

33
public class Sample
44
{
55
public static void Main()
66
{
77
// <Snippet1>
8-
String myString = "abc";
8+
string myString = "abc";
99
bool test1 = myString.Substring(2, 1).Equals("c"); // This is true.
1010
Console.WriteLine(test1);
11-
bool test2 = String.IsNullOrEmpty(myString.Substring(3, 0)); // This is true.
11+
bool test2 = string.IsNullOrEmpty(myString.Substring(3, 0)); // This is true.
1212
Console.WriteLine(test2);
1313
try
1414
{

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Close 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
#define TRACE
33

44
using System;
@@ -12,7 +12,7 @@ public static void Main()
1212
TextWriterTraceListener myTextListener = null;
1313

1414
// Create a file for output named TestFile.txt.
15-
String myFileName = "TestFile.txt";
15+
string myFileName = "TestFile.txt";
1616
StreamWriter myOutputWriter = new StreamWriter(myFileName, true);
1717

1818
// Add a TextWriterTraceListener for the file.

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs 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.Threading;
44
using System.Windows.Forms;
@@ -57,7 +57,7 @@ private static DialogResult ShowThreadExceptionDialog(Exception e)
5757
{
5858
string errorMsg = "An error occurred. Please contact the adminstrator " +
5959
"with the following information:\n\n";
60-
errorMsg += String.Format("Exception Type: {0}\n\n", e.GetType().Name);
60+
errorMsg += string.Format("Exception Type: {0}\n\n", e.GetType().Name);
6161
errorMsg += "\n\nStack Trace:\n" + e.StackTrace;
6262
return MessageBox.Show(errorMsg, "Application Error",
6363
MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail1 Example/CS/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define TRACE
1+
#define TRACE
22

33
using System;
44
using System.Data;
@@ -16,7 +16,7 @@ public void Method(Option option, string userInput)
1616
int value = 0;
1717
int newValue = 1;
1818
try {
19-
value = Int32.Parse(userInput);
19+
value = int.Parse(userInput);
2020
}
2121
// <Snippet1>
2222
catch (Exception) {

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write2 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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write3 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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.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;
@@ -10,7 +10,7 @@ public class Form1: Form
1010
// Create a TraceSwitch.
1111
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
1212

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

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TripleDESCryptoServiceProvider 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[] tdesKey, byte[] tdesIV)
9+
private static void EncryptData(string inName, string outName, byte[] tdesKey, byte[] tdesIV)
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 WindowsPrincipal.Identity 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.Security.Principal;
44
using System.Windows.Forms;
@@ -9,7 +9,7 @@ protected void Method()
99
{
1010
// <Snippet1>
1111
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
12-
String username = wp.Identity.Name;
12+
string username = wp.Identity.Name;
1313

1414
// </Snippet1>
1515
}

samples/snippets/csharp/VS_Snippets_CLR_System/system.Action_PrintExample/cs/action.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33

44
class Program

samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Action3.cs

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

44
public class TestAction3

samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Anon.cs

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

44
public class TestAnon

samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Delegate.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

44
delegate void StringCopy(string[] stringArray1,

samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Lambda.cs

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

44
public class TestLambda

samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Action4.cs

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

44
public class TestAction4

0 commit comments

Comments
 (0)