Skip to content

Commit 250449b

Browse files
ChrisMaddockmairaw
authored andcommitted
Add language identifiers to inline snippets (dotnet#176)
1 parent 917b89a commit 250449b

File tree

13 files changed

+40
-40
lines changed

13 files changed

+40
-40
lines changed

xml/Microsoft.Windows.Themes/SystemDropShadowChrome.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<a name="xamlObjectElementUsage_SDSC"></a>
4444
## XAML Object Element Usage
4545
46-
```
46+
```xaml
4747
<theme:SystemDropShadowChrome ...>
4848
  singleChild
4949
</theme:SystemDropShadowChrome>

xml/System.Globalization/CultureAndRegionInfoBuilder.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@
329329
330330
In the LDML file, the properties of a culture are specified as child elements of the `<special>` element in the `<identity>` section. A property value is typically specified by the element's `type` attribute. For example, the following excerpt from an LDML file defines a culture's parent as the English neutral culture.
331331
332-
```
333-
332+
```xml
334333
<identity>
335334
<version number="1.1">ldml version 1.1</version>
336335
<generation date="2012-05-16" />
@@ -340,7 +339,6 @@
340339
<!—content removed -->
341340
</special>
342341
</identity>
343-
344342
```
345343
346344
For more information about the LDML standard, see [Unicode Technical Standard #35, "Locale Data Markup Language (LDML)"](http://go.microsoft.com/fwlink/p/?LinkId=252840) on the Unicode Consortium website.

xml/System.Globalization/CultureInfo.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,9 +1437,9 @@ greeting =Hello again!
14371437
newGreeting=Hello!
14381438
```
14391439
1440-
It is compiled to a binary .resources file named GreetingStrings.resources by using the [Resource File Generator](~/docs/framework/tools/resgen-exe-resource-file-generator.md) with the following command.
1440+
It is compiled to a binary .resources file named GreetingStrings.resources by using the [Resource File Generator](~/docs/framework/tools/resgen-exe-resource-file-generator.md) with the following command.
14411441
1442-
```
1442+
```console
14431443
resgen greetingstrings.txt
14441444
```
14451445
@@ -1450,27 +1450,27 @@ greeting=Еще раз привет!
14501450
newGreeting=Привет!
14511451
```
14521452
1453-
It is compiled to a binary .resources file named GreetingStrings.ru-RU.resources by using the [Resource File Generator](~/docs/framework/tools/resgen-exe-resource-file-generator.md) with the following command.
1453+
It is compiled to a binary .resources file named GreetingStrings.ru-RU.resources by using the [Resource File Generator](~/docs/framework/tools/resgen-exe-resource-file-generator.md) with the following command.
14541454
1455-
```
1455+
```console
14561456
resgen greetingstrings.ru-RU.txt
14571457
```
14581458
14591459
The application code, which is shown below, resides in a file named Example1.vb or Example1.cs. It is compiled to an executable by using the following command for the Visual Basic compiler:
14601460
1461-
```
1461+
```console
14621462
vbc Example1.vb /resource:GreetingStrings.resources
14631463
```
14641464
14651465
For the C# compiler, the command is similar:
14661466
1467-
```
1467+
```console
14681468
csc /resource:GreetingStrings.resources Example1.cs
14691469
```
14701470
1471-
This creates an assembly that includes the example's executable code along with the resources for its fallback culture. You can also use the [Assembly Linker](~/docs/framework/tools/al-exe-assembly-linker.md) to create the resource file for the Russian (Russia) culture with the following command:
1471+
This creates an assembly that includes the example's executable code along with the resources for its fallback culture. You can also use the [Assembly Linker](~/docs/framework/tools/al-exe-assembly-linker.md) to create the resource file for the Russian (Russia) culture with the following command:
14721472
1473-
```
1473+
```console
14741474
>al /embed:greetingstrings.ru-RU.resources /c:ru-RU /template:example1.exe /out:ru-RU\Example1.resources.dll
14751475
```
14761476

xml/System.Net/Cookie.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@
140140
141141
The `value` parameter for a <xref:System.Net.Cookie> must not be a `null` reference (Nothing in Visual Basic). The semicolon (";") and comma (",") characters are reserved and cannot be passed in the `value` parameter unless the string passed in the `value` parameter is enclosed in double quotes. So the following example constructor would succeed, but when you try to add this <xref:System.Net.Cookie> to a <xref:System.Net.CookieContainer> instance with the <xref:System.Net.CookieContainer.Add(System.Net.Cookie)> or <xref:System.Net.CookieContainer.Add(System.Uri,System.Net.Cookie)> methods, the operation will fail and throw an exception:
142142
143-
```
143+
```csharp
144144
System.Net.Cookie cookie = new System.Net.Cookie("contoso", "123,456");
145145
cookie.Domain = "https://contoso.com";
146146
new CookieContainer().Add(cookie);
147147
```
148148
149149
However, the following constructor with these special characters escaped will create a <xref:System.Net.Cookie> that can be added to a <xref:System.Net.CookieContainer> instance:
150150
151-
```
151+
```csharp
152152
System.Net.Cookie cookie = new System.Net.Cookie("contoso", "\"123,456\"");
153153
cookie.Domain = "https://contoso.com";
154154
new CookieContainer().Add(cookie);
@@ -222,15 +222,15 @@
222222
223223
The `value` parameter for a <xref:System.Net.Cookie> must not be a `null` reference (Nothing in Visual Basic). The semicolon (";") and comma (",") characters are reserved and cannot be passed in the `value` parameter unless the string passed in the `value` parameter is enclosed in double quotes. So the following example constructor would succeed, but when you try to add this <xref:System.Net.Cookie> to a <xref:System.Net.CookieContainer> instance with the <xref:System.Net.CookieContainer.Add(System.Net.Cookie)> or <xref:System.Net.CookieContainer.Add(System.Uri,System.Net.Cookie)> methods, the operation will fail and throw an exception:
224224
225-
```
225+
```csharp
226226
System.Net.Cookie cookie = new System.Net.Cookie("contoso", "123,456", "");
227227
cookie.Domain = "https://contoso.com";
228228
new CookieContainer().Add(cookie);
229229
```
230230
231231
However, the following constructor with these special characters escaped will create a <xref:System.Net.Cookie> that can be added to a <xref:System.Net.CookieContainer> instance:
232232
233-
```
233+
```csharp
234234
System.Net.Cookie cookie = new System.Net.Cookie("contoso", "\"123,456\"", "");
235235
cookie.Domain = "https://contoso.com";
236236
new CookieContainer().Add(cookie);
@@ -306,14 +306,14 @@
306306
307307
The `value` parameter for a <xref:System.Net.Cookie> must not be a `null` reference (Nothing in Visual Basic). The semicolon (";") and comma (",") characters are reserved and cannot be passed in the `value` parameter unless the string passed in the `value` parameter is enclosed in double quotes. So the following example constructor would succeed, but when you try to add this <xref:System.Net.Cookie> to a <xref:System.Net.CookieContainer> instance with the <xref:System.Net.CookieContainer.Add(System.Net.Cookie)> or <xref:System.Net.CookieContainer.Add(System.Uri,System.Net.Cookie)> methods, the operation will fail and throw an exception:
308308
309-
```
309+
```csharp
310310
System.Net.Cookie cookie = new System.Net.Cookie("contoso", "123,456", "", "https://contoso.com");
311311
new CookieContainer().Add(cookie);
312312
```
313313
314314
However, the following constructor with these special characters escaped will create a <xref:System.Net.Cookie> that can be added to a <xref:System.Net.CookieContainer> instance:
315315
316-
```
316+
```csharp
317317
System.Net.Cookie cookie = new System.Net.Cookie("contoso", "\"123,456\"", "", "https://contoso.com");
318318
new CookieContainer().Add(cookie);
319319
```

xml/System.Net/WebClient.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,14 +1381,16 @@
13811381
> [!NOTE]
13821382
> A passive FTP file transfer will always show a progress percentage of zero, since the server did not send the file size. To show progress, you can change the FTP connection to active by overriding the <xref:System.Net.WebClient.GetWebRequest%2A> virtual method:
13831383
1384-
```
1385-
internal class MyWebClient:WebClient{
1386-
protected override WebRequest GetWebRequest(Uri address) {
1387-
FtpWebRequest req = (FtpWebRequest)base.GetWebRequest(address);
1388-
req.UsePassive = false;
1389-
return req;
1390-
}
1384+
```csharp
1385+
internal class MyWebClient : WebClient
1386+
{
1387+
protected override WebRequest GetWebRequest(Uri address)
1388+
{
1389+
FtpWebRequest req = (FtpWebRequest)base.GetWebRequest(address);
1390+
req.UsePassive = false;
1391+
return req;
13911392
}
1393+
}
13921394
```
13931395
13941396

xml/System.Printing/PrintCapabilities.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
## Examples
451451
The following code example shows how to search for a particular value in the <xref:System.Printing.PrintCapabilities.PageMediaSizeCapability%2A>.
452452
453-
```
453+
```csharp
454454
foreach (PageMediaSize mediaSize in pc.PageMediaSizeCapability)
455455
{
456456
if (mediaSize.PageMediaSizeName == PageMediaSizeName.ISOA4)
@@ -586,7 +586,7 @@ foreach (PageMediaSize mediaSize in pc.PageMediaSizeCapability)
586586
## Examples
587587
The following code example shows how to search for a particular value in the <xref:System.Printing.PrintCapabilities.PageResolutionCapability%2A>.
588588
589-
```
589+
```csharp
590590
foreach (PageResolution pageRes in pc.PageResolutionCapability)
591591
{
592592
if (pageRes.QualitativeResolution == PageQualitativeResolution.High)

xml/System/Array.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5676,13 +5676,13 @@
56765676
## Remarks
56775677
For example, the Visual Basic code
56785678

5679-
```
5679+
```vb
56805680
Dim TDArray(0,0,0) As Integer
56815681
```
56825682

56835683
and the C# code
56845684

5685-
```
5685+
```csharp
56865686
int[,,] TDArray = new int[1,1,1];
56875687
```
56885688

xml/System/CLSCompliantAttribute.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@
6666
## Examples
6767
The following example applies a <xref:System.CLSCompliantAttribute> to the entire assembly.
6868
69-
```
69+
```csharp
7070
using System;
7171
[assembly: CLSCompliant(true)]
7272
```
7373
7474
The following declaration generates a CLS-compliance warning because the type `UInt32` is not specified in the CLS.
7575
76-
```
76+
```csharp
7777
public int SetValue(UInt32 value);
7878
```
7979
8080
If the declaration is marked with a <xref:System.CLSCompliantAttribute>, no compiler warning or error is generated.
8181
82-
```
82+
```csharp
8383
[CLSCompliant(false)]
8484
public int SetValue(UInt32 value);
8585
```

xml/System/NonSerializedAttribute.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
4848
To apply the <xref:System.NonSerializedAttribute> class to an event, set the attribute location to field, as shown in the following C# code.
4949
50-
```
50+
```csharp
5151
[field:NonSerializedAttribute()]
5252
public event ChangedEventHandler Changed;
5353
```

xml/System/Object.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,13 +1031,13 @@ The scope of the <xref:System.Object.Finalize%2A?displayProperty=nameWithType> m
10311031
10321032
- You can define the [IStringable](http://msdn.microsoft.com/library/windows/apps/windows.foundation.istringable.aspx) interface only in a "class implements" relationship, such as
10331033
1034-
```
1034+
```csharp
10351035
public class NewClass : IStringable
10361036
```
10371037
10381038
in C#, or
10391039
1040-
```
1040+
```vb
10411041
Public Class NewClass : Implements IStringable
10421042
```
10431043
@@ -1051,7 +1051,7 @@ The scope of the <xref:System.Object.Finalize%2A?displayProperty=nameWithType> m
10511051
10521052
- You cannot hide your [IStringable](http://msdn.microsoft.com/library/windows/apps/windows.foundation.istringable.aspx) implementation from base classes by using a method definition such as the following:
10531053
1054-
```
1054+
```csharp
10551055
10561056
public class NewClass : IStringable
10571057
{

0 commit comments

Comments
 (0)