Skip to content

Commit 68cc4e3

Browse files
Names -> Keywords
Replacing full type names with keywords when appropriate Files affected: Program.cs, Program.cs, Program.cs. See dotnet#6920
1 parent 9914215 commit 68cc4e3

File tree

20 files changed

+76
-76
lines changed

20 files changed

+76
-76
lines changed

samples/snippets/csharp/VS_Snippets_CLR_System/system.String.CompareCmp/cs/cmpcmp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This example demonstrates the
3-
// System.String.Compare(String, String, StringComparison) method.
3+
// string.Compare(String, String, StringComparison) method.
44

55
using System;
66
using System.Threading;

samples/snippets/csharp/VS_Snippets_CLR_System/system.String.EndsWithCmp/cs/ewcmp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This example demonstrates the
3-
// System.String.EndsWith(String, StringComparison) method.
3+
// string.EndsWith(String, StringComparison) method.
44

55
using System;
66
using System.Threading;

samples/snippets/csharp/VS_Snippets_CLR_System/system.StringComparer/cs/omni.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This example demonstrates members of the
3-
// System.StringComparer class.
3+
// stringComparer class.
44

55
using System;
66
using System.Collections;

samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.UnicodeEncoding.ErrorDetection/CS/errordetection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// The following code example demonstrates the behavior of UnicodeEncoding with error detection enabled and without.
1+
// The following code example demonstrates the behavior of UnicodeEncoding with error detection enabled and without.
22

33
// <Snippet1>
44
using System;
@@ -63,7 +63,7 @@ This code produces the following output.
6363
Decoding with error detection:
6464
System.ArgumentException: Invalid byte was found at byte index 3.
6565
at System.Text.UnicodeEncoding.GetCharCount(Byte* bytes, Int32 count, DecoderNLS baseDecoder)
66-
at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
66+
at string.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
6767
at System.Text.UnicodeEncoding.GetString(Byte[] bytes, Int32 index, Int32 count)
6868
at SamplesUnicodeEncoding.PrintDecodedString(Byte[] bytes, Encoding enc)
6969

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type.BindGenericParameters/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.Reflection;
44
using System.Collections.Generic;
@@ -66,11 +66,11 @@ List type arguments (2):
6666
TKey
6767
TValue
6868
69-
System.Collections.Generic.Dictionary`2[System.String, Test]
69+
System.Collections.Generic.Dictionary`2[string, Test]
7070
Is this a generic type definition? False
7171
Is it a generic type? True
7272
List type arguments (2):
73-
System.String
73+
string
7474
Test
7575
7676
--- Compare types obtained by different methods:

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type.GetGenericTypeDefinition/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.Reflection;
44
using System.Collections.Generic;
@@ -42,11 +42,11 @@ private static void DisplayTypeInfo(Type t)
4242
4343
--- Get the generic type that defines a constructed type.
4444
45-
System.Collections.Generic.Dictionary`2[System.String,Test]
45+
System.Collections.Generic.Dictionary`2[string,Test]
4646
Is this a generic type definition? False
4747
Is it a generic type? True
4848
List type arguments (2):
49-
System.String
49+
string
5050
Test
5151
5252
System.Collections.Generic.Dictionary`2[TKey,TValue]

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type.HasUnboundGenericParameters/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.Reflection;
44
using System.Collections.Generic;
@@ -92,12 +92,12 @@ Does it have unassigned generic parameters? True
9292
List type arguments (1):
9393
V (unassigned - parameter position 0)
9494
95-
Base`2[System.Int32,V]
95+
Base`2[int,V]
9696
Is this a generic type definition? False
9797
Is it a generic type? True
9898
Does it have unassigned generic parameters? True
9999
List type arguments (2):
100-
System.Int32
100+
int
101101
V (unassigned - parameter position 0)
102102
*/
103103
//</Snippet1>

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type.IsGenericParameter/CS/source.cs

Lines changed: 4 additions & 4 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.Collections.Generic;
@@ -69,11 +69,11 @@ public static void Main()
6969
--- Display information about a constructed type, its
7070
generic type definition, and an ordinary type.
7171
72-
System.Collections.Generic.Dictionary[System.String,Test]
72+
System.Collections.Generic.Dictionary[string,Test]
7373
Is this a generic type definition? False
7474
Is it a generic type? True
7575
List type arguments (2):
76-
System.String
76+
string
7777
Test
7878
7979
System.Collections.Generic.Dictionary[TKey,TValue]
@@ -83,7 +83,7 @@ List type arguments (2):
8383
TKey (unassigned - parameter position 0)
8484
TValue (unassigned - parameter position 1)
8585
86-
System.String
86+
string
8787
Is this a generic type definition? False
8888
Is it a generic type? False
8989
*/

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type.IsGenericType/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.Reflection;
44

@@ -72,14 +72,14 @@ public static void DisplayGenericType(Type t, string caption)
7272
IsGenericParameter: False
7373
7474
Base type of Derived<V>
75-
Type: Base`2[System.String,V]
75+
Type: Base`2[string,V]
7676
IsGenericType: True
7777
IsGenericTypeDefinition: False
7878
ContainsGenericParameters: True
7979
IsGenericParameter: False
8080
8181
Array of Derived<int>
82-
Type: Derived`1[System.Int32][]
82+
Type: Derived`1[int][]
8383
IsGenericType: False
8484
IsGenericTypeDefinition: False
8585
ContainsGenericParameters: False

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type.IsGenericTypeDefinition/CS/source.cs

Lines changed: 4 additions & 4 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.Collections.Generic;
@@ -69,11 +69,11 @@ public static void Main()
6969
--- Display information about a constructed type, its
7070
generic type definition, and an ordinary type.
7171
72-
System.Collections.Generic.Dictionary[System.String,Test]
72+
System.Collections.Generic.Dictionary[string,Test]
7373
Is this a generic type definition? False
7474
Is it a generic type? True
7575
List type arguments (2):
76-
System.String
76+
string
7777
Test
7878
7979
System.Collections.Generic.Dictionary[TKey,TValue]
@@ -83,7 +83,7 @@ List type arguments (2):
8383
TKey (unassigned - parameter position 0)
8484
TValue (unassigned - parameter position 1)
8585
86-
System.String
86+
string
8787
Is this a generic type definition? False
8888
Is it a generic type? False
8989
*/

samples/snippets/csharp/VS_Snippets_CLR_System/system.Type/cs/source.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// The following code example demonstrates that Type objects are returned
1+
// The following code example demonstrates that Type objects are returned
22
// by the typeid operator, and shows how Type objects are used in reflection
33
// to explore information about types and to invoke members of types.
44
//<Snippet1>
@@ -22,6 +22,6 @@ static void Main()
2222

2323
/* This code example produces the following output:
2424
25-
System.String Substring(Int32, Int32) returned "World".
25+
string Substring(Int32, Int32) returned "World".
2626
*/
2727
//</Snippet1>

samples/snippets/csharp/VS_Snippets_CLR_System/system.string.EndsWithCI/cs/ewci.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This code example demonstrates the
3-
// System.String.EndsWith(String, ..., CultureInfo) method.
3+
// string.EndsWith(String, ..., CultureInfo) method.
44

55
using System;
66
using System.Threading;

samples/snippets/csharp/VS_Snippets_CLR_System/system.string.IndexOfCmp/cs/iocmp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This code example demonstrates the
3-
// System.String.IndexOf(String, ..., StringComparison) methods.
3+
// string.IndexOf(String, ..., StringComparison) methods.
44

55
using System;
66
using System.Threading;

samples/snippets/csharp/VS_Snippets_CLR_System/system.string.LastIndexOfCmp/cs/liocmp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This code example demonstrates the
3-
// System.String.LastIndexOf(String, ..., StringComparison) methods.
3+
// string.LastIndexOf(String, ..., StringComparison) methods.
44

55
using System;
66
using System.Threading;

samples/snippets/csharp/VS_Snippets_CLR_System/system.string.StartsWithCI/cs/swci.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//<snippet1>
1+
//<snippet1>
22
// This code example demonstrates the
3-
// System.String.StartsWith(String, ..., CultureInfo) method.
3+
// string.StartsWith(String, ..., CultureInfo) method.
44

55
using System;
66
using System.Threading;

samples/snippets/csharp/VS_Snippets_CLR_System/system.type.fullname/cs/fullnameex1.cs

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

@@ -18,6 +18,6 @@ public static void Main()
1818
// The example displays the following output:
1919
// System.Collections.Generic.List`1
2020
//
21-
// System.Collections.Generic.List`1[[System.String, mscorlib,
21+
// System.Collections.Generic.List`1[[string, mscorlib,
2222
// Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
2323
// </Snippet2>

samples/snippets/csharp/VS_Snippets_CLR_System/system.type.tostring/cs/fullname1.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <Snippet1>
1+
// <Snippet1>
22
using System;
33
using System.Collections.Generic;
44
using System.Globalization;
@@ -40,9 +40,9 @@ private static void ShowTypeInfo(Type t)
4040
}
4141
// The example displays output like the following:
4242
// Name: String
43-
// Full Name: System.String
44-
// ToString: System.String
45-
// Assembly Qualified Name: System.String, mscorlib, Version=4.0.0.0, Culture=neutr
43+
// Full Name: string
44+
// ToString: string
45+
// Assembly Qualified Name: string, mscorlib, Version=4.0.0.0, Culture=neutr
4646
// al, PublicKeyToken=b77a5c561934e089
4747
//
4848
// Name: List`1
@@ -52,17 +52,17 @@ private static void ShowTypeInfo(Type t)
5252
// 0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
5353
//
5454
// Name: List`1
55-
// Full Name: System.Collections.Generic.List`1[[System.String, mscorlib, Version=4
55+
// Full Name: System.Collections.Generic.List`1[[string, mscorlib, Version=4
5656
// .0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
57-
// ToString: System.Collections.Generic.List`1[System.String]
58-
// Assembly Qualified Name: System.Collections.Generic.List`1[[System.String, mscor
57+
// ToString: System.Collections.Generic.List`1[string]
58+
// Assembly Qualified Name: System.Collections.Generic.List`1[[string, mscor
5959
// lib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorl
6060
// ib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
6161
//
6262
// Name: Int32
63-
// Full Name: System.Int32
64-
// ToString: System.Int32
65-
// Assembly Qualified Name: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutra
63+
// Full Name: int
64+
// ToString: int
65+
// Assembly Qualified Name: int, mscorlib, Version=4.0.0.0, Culture=neutra
6666
// l, PublicKeyToken=b77a5c561934e089
6767
//
6868
// Name: IFormatProvider

samples/snippets/csharp/api/system.globalization/japanesecalendar/todatetime/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Globalization;
33

44
class Program
@@ -9,12 +9,12 @@ static void Main()
99
var jaJp = new CultureInfo("ja-JP");
1010
jaJp.DateTimeFormat.Calendar = cal;
1111
var date1 = cal.ToDateTime(2,1,1,0,0,0,0,JapaneseCalendar.CurrentEra);
12-
Console.WriteLine($"Japanese calendar date: {date1.ToString("D", jaJp)}, " +
13-
$"Gregorian calendar date: {date1.ToString("D", CultureInfo.InvariantCulture)}");
12+
Console.WriteLine($"Japanese calendar date: {date1.Tostring("D", jaJp)}, " +
13+
$"Gregorian calendar date: {date1.Tostring("D", CultureInfo.InvariantCulture)}");
1414

1515
var date2 = cal.ToDateTime(6,11,7,0,0,0,0,GetEraIndex("大正"));
16-
Console.WriteLine($"Japanese calendar date: {date2.ToString("D", jaJp)}, " +
17-
$"Gregorian calendar date: {date2.ToString("D", CultureInfo.InvariantCulture)}");
16+
Console.WriteLine($"Japanese calendar date: {date2.Tostring("D", jaJp)}, " +
17+
$"Gregorian calendar date: {date2.Tostring("D", CultureInfo.InvariantCulture)}");
1818

1919
int GetEraIndex(string eraName)
2020
{

samples/snippets/csharp/api/system.io/path/combine/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
using System;
1+
using System;
22
using System.IO;
33

44
class Program
55
{
66
static void Main(string[] args)
77
{
8-
Console.WriteLine("Path.Combine(String[])");
8+
Console.WriteLine("Path.Combine(string[])");
99
Combine1();
10-
Console.WriteLine("\nPath.Combine(String,String)");
10+
Console.WriteLine("\nPath.Combine(string,string)");
1111
Combine2();
12-
Console.WriteLine("\nPath.Combine(String,String,String)");
12+
Console.WriteLine("\nPath.Combine(string,string,string)");
1313
Combine3();
14-
Console.WriteLine("\nPath.Combine(String,String,String,String)");
14+
Console.WriteLine("\nPath.Combine(string,string,string,string)");
1515
Combine4();
1616
}
1717

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
using System;
1+
using System;
22
using System.IO;
33

44
class Program
55
{
66
static void Main()
77
{
8-
Console.WriteLine($"Path.DirectorySeparatorChar: '{Path.DirectorySeparatorChar}'");
9-
Console.WriteLine($"Path.AltDirectorySeparatorChar: '{Path.AltDirectorySeparatorChar}'");
8+
Console.WriteLine($"Path.DirectorySeparatorchar: '{Path.DirectorySeparatorchar}'");
9+
Console.WriteLine($"Path.AltDirectorySeparatorchar: '{Path.AltDirectorySeparatorchar}'");
1010
Console.WriteLine($"Path.PathSeparator: '{Path.PathSeparator}'");
11-
Console.WriteLine($"Path.VolumeSeparatorChar: '{Path.VolumeSeparatorChar}'");
12-
var invalidChars = Path.GetInvalidPathChars();
13-
Console.WriteLine($"Path.GetInvalidPathChars:");
14-
for (int ctr = 0; ctr < invalidChars.Length; ctr++)
11+
Console.WriteLine($"Path.VolumeSeparatorchar: '{Path.VolumeSeparatorchar}'");
12+
var invalidchars = Path.GetInvalidPathchars();
13+
Console.WriteLine($"Path.GetInvalidPathchars:");
14+
for (int ctr = 0; ctr < invalidchars.Length; ctr++)
1515
{
16-
Console.Write($" U+{Convert.ToUInt16(invalidChars[ctr]):X4} ");
16+
Console.Write($" U+{Convert.ToUInt16(invalidchars[ctr]):X4} ");
1717
if ((ctr + 1) % 10 == 0) Console.WriteLine();
1818
}
1919
Console.WriteLine();
2020
}
2121
}
2222
// The example displays the following output when run on a Windows system:
23-
// Path.DirectorySeparatorChar: '\'
24-
// Path.AltDirectorySeparatorChar: '/'
23+
// Path.DirectorySeparatorchar: '\'
24+
// Path.AltDirectorySeparatorchar: '/'
2525
// Path.PathSeparator: ';'
26-
// Path.VolumeSeparatorChar: ':'
27-
// Path.GetInvalidPathChars:
26+
// Path.VolumeSeparatorchar: ':'
27+
// Path.GetInvalidPathchars:
2828
// U+007C) U+0000) U+0001) U+0002) U+0003) U+0004) U+0005) U+0006) U+0007) U+0008)
2929
// U+0009) U+000A) U+000B) U+000C) U+000D) U+000E) U+000F) U+0010) U+0011) U+0012)
3030
// U+0013) U+0014) U+0015) U+0016) U+0017) U+0018) U+0019) U+001A) U+001B) U+001C)
3131
// U+001D) U+001E) U+001F)
3232
//
3333
// The example displays the following output when run on a Linux system:
34-
// Path.DirectorySeparatorChar: '/'
35-
// Path.AltDirectorySeparatorChar: '/'
34+
// Path.DirectorySeparatorchar: '/'
35+
// Path.AltDirectorySeparatorchar: '/'
3636
// Path.PathSeparator: ':'
37-
// Path.VolumeSeparatorChar: '/'
38-
// Path.GetInvalidPathChars:
37+
// Path.VolumeSeparatorchar: '/'
38+
// Path.GetInvalidPathchars:
3939
// U+0000

0 commit comments

Comments
 (0)