Skip to content

Commit fceb726

Browse files
authored
Extract long remarks for System.Globalization (#9526)
1 parent 0e96164 commit fceb726

File tree

83 files changed

+2467
-6437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2467
-6437
lines changed

snippets/csharp/System.Globalization/CultureInfo/Overview/Change1.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/ChangeUI1.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/Current1.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/CurrentUI1.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/GetCultures1.cs

Lines changed: 0 additions & 40 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/appdomainex1.cs

Lines changed: 0 additions & 76 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/asyncculture1.cs

Lines changed: 0 additions & 90 deletions
This file was deleted.

snippets/csharp/System.Globalization/CultureInfo/Overview/asyncculture2.cs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,54 @@
11
// <Snippet2>
22
using System;
33
using System.Globalization;
4-
using System.Runtime.Versioning;
54
using System.Threading;
65
using System.Threading.Tasks;
76

8-
public class Example
7+
public class AsyncCultureEx
98
{
10-
public static void Main()
11-
{
12-
decimal[] values = { 163025412.32m, 18905365.59m };
13-
string formatString = "C2";
14-
Func<String> formatDelegate = () => { string output = String.Format("Formatting using the {0} culture on thread {1}.\n",
15-
CultureInfo.CurrentCulture.Name,
16-
Thread.CurrentThread.ManagedThreadId);
17-
foreach (var value in values)
18-
output += String.Format("{0} ", value.ToString(formatString));
9+
public static void Main()
10+
{
11+
decimal[] values = { 163025412.32m, 18905365.59m };
12+
string formatString = "C2";
13+
Func<String> formatDelegate = () =>
14+
{
15+
string output = String.Format("Formatting using the {0} culture on thread {1}.\n",
16+
CultureInfo.CurrentCulture.Name,
17+
Thread.CurrentThread.ManagedThreadId);
18+
foreach (var value in values)
19+
output += String.Format("{0} ", value.ToString(formatString));
1920

20-
output += Environment.NewLine;
21-
return output;
22-
};
21+
output += Environment.NewLine;
22+
return output;
23+
};
2324

24-
Console.WriteLine("The example is running on thread {0}",
25-
Thread.CurrentThread.ManagedThreadId);
26-
// Make the current culture different from the system culture.
27-
Console.WriteLine("The current culture is {0}",
28-
CultureInfo.CurrentCulture.Name);
29-
if (CultureInfo.CurrentCulture.Name == "fr-FR")
30-
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
31-
else
32-
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
25+
Console.WriteLine("The example is running on thread {0}",
26+
Thread.CurrentThread.ManagedThreadId);
27+
// Make the current culture different from the system culture.
28+
Console.WriteLine("The current culture is {0}",
29+
CultureInfo.CurrentCulture.Name);
30+
if (CultureInfo.CurrentCulture.Name == "fr-FR")
31+
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
32+
else
33+
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
3334

34-
Console.WriteLine("Changed the current culture to {0}.\n",
35-
CultureInfo.CurrentCulture.Name);
35+
Console.WriteLine("Changed the current culture to {0}.\n",
36+
CultureInfo.CurrentCulture.Name);
3637

37-
// Execute the delegate synchronously.
38-
Console.WriteLine("Executing the delegate synchronously:");
39-
Console.WriteLine(formatDelegate());
38+
// Execute the delegate synchronously.
39+
Console.WriteLine("Executing the delegate synchronously:");
40+
Console.WriteLine(formatDelegate());
4041

41-
// Call an async delegate to format the values using one format string.
42-
Console.WriteLine("Executing a task asynchronously:");
43-
var t1 = Task.Run(formatDelegate);
44-
Console.WriteLine(t1.Result);
42+
// Call an async delegate to format the values using one format string.
43+
Console.WriteLine("Executing a task asynchronously:");
44+
var t1 = Task.Run(formatDelegate);
45+
Console.WriteLine(t1.Result);
4546

46-
Console.WriteLine("Executing a task synchronously:");
47-
var t2 = new Task<String>(formatDelegate);
48-
t2.RunSynchronously();
49-
Console.WriteLine(t2.Result);
50-
}
47+
Console.WriteLine("Executing a task synchronously:");
48+
var t2 = new Task<String>(formatDelegate);
49+
t2.RunSynchronously();
50+
Console.WriteLine(t2.Result);
51+
}
5152
}
5253
// The example displays the following output:
5354
// The example is running on thread 1

0 commit comments

Comments
 (0)