Skip to content

Commit 2338581

Browse files
authored
Merge pull request #927 from dotnet/master
Update live with current master
2 parents 1a3d96c + bcc4c5e commit 2338581

File tree

5 files changed

+22
-13
lines changed
  • csharp/events
  • snippets
    • csharp
    • standard/base-types/format-strings/csharp

5 files changed

+22
-13
lines changed

csharp/events/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Program
1212
{
1313
static void Main(string[] args)
1414
{
15-
var lister = new FileSearcher();
15+
var fileLister = new FileSearcher();
1616
int filesFound = 0;
1717

1818
// <SnippetDeclareEventHandler>
@@ -22,21 +22,21 @@ static void Main(string[] args)
2222
filesFound++;
2323
};
2424

25-
lister.FileFound += onFileFound;
25+
fileLister.FileFound += onFileFound;
2626
// </SnippetDeclareEventHandler>
2727

2828
// <SnippetSearch>
29-
lister.DirectoryChanged += (sender, eventArgs) =>
29+
fileLister.DirectoryChanged += (sender, eventArgs) =>
3030
{
3131
Console.Write($"Entering '{eventArgs.CurrentSearchDirectory}'.");
3232
Console.WriteLine($" {eventArgs.CompletedDirs} of {eventArgs.TotalDirs} completed...");
3333
};
3434
// </SnippetSearch>
3535

36-
lister.Search(".", "*.dll", true);
36+
fileLister.Search(".", "*.dll", true);
3737

3838
// <SnippetRemoveHandler>
39-
lister.FileFound -= onFileFound;
39+
fileLister.FileFound -= onFileFound;
4040
// </SnippetRemoveHandler>
4141
}
4242
}

snippets/csharp/VS_Snippets_CLR/Formatting.Numeric.Standard/cs/Standard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void ShowCurrency()
5151
// current culture is English (United States):
5252
// $12,345.68
5353
// $12,345.679
54-
// kr 12.345,679
54+
// 12.345,679 kr
5555
// </Snippet1>
5656
}
5757

snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/roundtripex1.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public class Example
66
{
77
static void Main(string[] args)
88
{
9+
// <SnippetRoundTrip>
910
Console.WriteLine("Attempting to round-trip a Double with 'R':");
1011
double initialValue = 0.6822871999174;
1112
string valueString = initialValue.ToString("R",
@@ -22,13 +23,14 @@ static void Main(string[] args)
2223
CultureInfo.InvariantCulture);
2324
Console.WriteLine("{0:R} = {1:R}: {2}\n",
2425
initialValue, roundTripped17, initialValue.Equals(roundTripped17));
26+
// If compiled to an application that targets anycpu or x64 and run on an x64 system,
27+
// the example displays the following output:
28+
// Attempting to round-trip a Double with 'R':
29+
// 0.6822871999174 = 0.68228719991740006: False
30+
//
31+
// Attempting to round-trip a Double with 'G17':
32+
// 0.6822871999174 = 0.6822871999174: True
33+
// </SnippetRoundTrip>
2534
}
2635
}
27-
// If compiled to an application that targets anycpu or x64 and run on an x64 system,
28-
// the example displays the following output:
29-
// Attempting to round-trip a Double with 'R':
30-
// 0.6822871999174 = 0.68228719991740006: False
31-
//
32-
// Attempting to round-trip a Double with 'G17':
33-
// 0.6822871999174 = 0.6822871999174: True
3436
// </Snippet5>

snippets/csharp/VS_Snippets_CLR_System/system.X.ToString-and-Culture/cs/xts.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public class NumericFormats
176176
{
177177
public static void Main()
178178
{
179+
// <SnippetFinalExample>
179180
// Display string representations of numbers for en-us culture
180181
CultureInfo ci = new CultureInfo("en-us");
181182

@@ -216,6 +217,7 @@ public static void Main()
216217
Console.WriteLine("X: 0x{0}",
217218
integral.ToString("X", ci)); // Displays "X: 0x20CB"
218219
Console.WriteLine();
220+
// </SnippetFinalExample>
219221
}
220222
}
221223
// </Snippet1>

snippets/standard/base-types/format-strings/csharp/g17.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class Example
44
{
55
public static void Main()
66
{
7+
// <SnippetGeneralFormatSpecifier>
78
double original = 0.84551240822557006;
89
var rSpecifier = original.ToString("R");
910
var g17Specifier = original.ToString("G17");
@@ -13,6 +14,10 @@ public static void Main()
1314

1415
Console.WriteLine($"{original:G17} = {rSpecifier} (R): {original.Equals(rValue)}");
1516
Console.WriteLine($"{original:G17} = {g17Specifier} (G17): {original.Equals(g17Value)}");
17+
// The example displays the following output:
18+
// 0.84551240822557006 = 0.84551240822557: False
19+
// 0.84551240822557006 = 0.84551240822557006: True
20+
// </SnippetGeneralFormatSpecifier>
1621
}
1722
}
1823
// The example displays the following output:

0 commit comments

Comments
 (0)