Skip to content

Fixed incorrectly marked code blocks in docs and xml. #2158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ You can use the <xref:System.Data.DataTable.Load%2A> method to load a <xref:Syst

The following sample uses the **Load** method to display a list of birthdays for the employees in the **Northwind** database.

[Visual Basic]

```
```vb
Private Sub LoadBirthdays(ByVal connectionString As String)
' Assumes that connectionString is a valid connection string
' to the Northwind database on SQL Server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ The **Connection** classes in each of the .NET Framework managed providers imple
### Retrieving Schema Collections Example
The following examples demonstrate how to use the <xref:System.Data.SqlClient.SqlConnection.GetSchema%2A> method of the .NET Framework Data Provider for the SQL Server <xref:System.Data.SqlClient.SqlConnection> class to retrieve schema information about all of the tables contained in the **AdventureWorks** sample database:

[Visual Basic]

```
```vb
Imports System.Data.SqlClient

Module Module1
Expand Down Expand Up @@ -64,9 +62,7 @@ Module Module1
End Module
```

[C#]

```
```csharp
using System;
using System.Data;
using System.Data.SqlClient;
Expand Down
8 changes: 2 additions & 6 deletions docs/framework/data/adonet/oracle-lobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ The .NET Framework Data Provider for Oracle includes the <xref:System.Data.Oracl
## Creating, Retrieving, and Writing to a LOB
The following C# example demonstrates how you can create LOBs in an Oracle table, and then retrieve and write to them in the form of **OracleLob** objects. The example demonstrates using the <xref:System.Data.OracleClient.OracleDataReader> object and the **OracleLob** **Read** and **Write** methods. The example uses Oracle **BLOB**, **CLOB**, and **NCLOB** data types.

[C#]

```
```csharp
using System;
using System.IO;
using System.Text;
Expand Down Expand Up @@ -226,9 +224,7 @@ public class LobExample
## Creating a Temporary LOB
The following C# example demonstrates how to create a temporary LOB.

[C#]

```
```csharp
OracleConnection conn = new OracleConnection(
"server=test8172; integrated security=yes;");
conn.Open();
Expand Down
8 changes: 2 additions & 6 deletions docs/framework/data/adonet/schema-restrictions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ The second optional parameter of the **GetSchema** method is the restrictions th
### Example
The following examples demonstrate how to use the <xref:System.Data.SqlClient.SqlConnection.GetSchema%2A> method of the .NET Framework Data Provider for the SQL Server <xref:System.Data.SqlClient.SqlConnection> class to retrieve schema information about all of the tables contained in the **AdventureWorks** sample database, and to restrict the information returned to only those tables in the "Sales" schema:

[Visual Basic]

```
```vb
Imports System.Data.SqlClient

Module Module1
Expand Down Expand Up @@ -75,9 +73,7 @@ End Sub
End Module
```

[C#]

```
```csharp
using System;
using System.Data;
using System.Data.SqlClient;
Expand Down
16 changes: 4 additions & 12 deletions docs/framework/data/adonet/sql/aspnet-apps-using-wait-handles.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ The callback and polling models for handling asynchronous operations are useful

Add the following code to the form's class, modifying the connection string as necessary for your environment.

[Visual Basic]

```
```vb
' Add these to the top of the class
Imports System
Imports System.Data
Expand Down Expand Up @@ -164,9 +162,7 @@ Imports System.Threading
End Sub
```

[C#]

```
```csharp
// Add the following using statements, if they are not already there.
using System;
using System.Data;
Expand Down Expand Up @@ -328,9 +324,7 @@ void Button1_Click(object sender, System.EventArgs e)

Add the following code to the form's class, modifying the connection string as necessary for your environment.

[Visual Basic]

```
```vb
' Add these to the top of the class
Imports System
Imports System.Data
Expand Down Expand Up @@ -451,9 +445,7 @@ Imports System.Threading
End Sub
```

[C#]

```
```csharp
// Add the following using statements, if they are not already there.
using System;
using System.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ Asynchronous operations in ADO.NET allow you to initiate time-consuming database
## Example
The following console application updates data within the **AdventureWorks** sample database, doing its work asynchronously. In order to emulate a long-running process, this example inserts a WAITFOR statement in the command text. Normally, you would not try to make your commands run slower, but doing so in this case makes it easier to demonstrate asynchronous behavior.

[Visual Basic]

```
```vb
Imports System
Imports System.Data.SqlClient

Expand Down Expand Up @@ -101,9 +99,7 @@ Module Module1
End Module
```

[C#]

```
```csharp
using System;
using System.Data;
using System.Data.SqlClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ Module Module1
End Module
```

[C#]

```
```csharp
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If a query requires a parameter whose value is an XML string, developers can sup

To create the file needed for the example to run, create a new text file in the same folder as your project. Name the file MyTestStoreData.xml. Open the file in Notepad and copy and paste the following text:

```
```xml
<StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey">
<AnnualSales>300000</AnnualSales>
<AnnualRevenue>30000</AnnualRevenue>
Expand All @@ -43,9 +43,7 @@ If a query requires a parameter whose value is an XML string, developers can sup
</StoreSurvey>
```

[Visual Basic]

```
```vb
Imports System
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Expand Down Expand Up @@ -103,9 +101,7 @@ End Sub
End Module
```

[C#]

```
```csharp
using System;
using System.Data;
using System.Data.SqlClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ In most asynchronous processing scenarios, you want to start a database operatio

To set up this example, create a new Windows application. Place a <xref:System.Windows.Forms.Button> control and two <xref:System.Windows.Forms.Label> controls on the form (accepting the default name for each control). Add the following code to the form's class, modifying the connection string as necessary for your environment.

[Visual Basic]

```
```vb
' Add these to the top of the class:
Imports System
Imports System.Data
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/interop/default-marshaling-for-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void New3(ref String ar);

You can provide the marshaler with the array size by editing the Microsoft intermediate language (MSIL) code produced by Tlbimp.exe and then recompiling it. For details about how to modify MSIL code, see [Customizing Runtime Callable Wrappers](http://msdn.microsoft.com/en-us/4652beaf-77d0-4f37-9687-ca193288c0be). To indicate the number of elements in the array, apply the <xref:System.Runtime.InteropServices.MarshalAsAttribute> type to the array parameter of the managed method definition in one of the following ways:

- Identify another parameter that contains the number of elements in the array. The parameters are identified by position, starting with the first parameter as number 0. [Visual Basic]
- Identify another parameter that contains the number of elements in the array. The parameters are identified by position, starting with the first parameter as number 0.

```vb
Sub [New](ElemCnt As Integer, _
Expand Down
6 changes: 0 additions & 6 deletions docs/framework/wcf/designing-service-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ public interface IMyContract

The following is the equivalent Visual Basic code.

[Visual Basic]

```vb
\<ServiceContractAttribute()> _
Public Interface IMyContract
Expand Down Expand Up @@ -203,8 +201,6 @@ public interface ISampleService

The following is the equivalent Visual Basic code.

[Visual Basic]

```vb
\<ServiceContractAttribute()> _
Public Interface ISampleService
Expand All @@ -216,7 +212,6 @@ Public Interface ISampleService
Public Function GetData() As Integer

End Interface

```

When interacting with an `ISampleService` implementation in an endpoint with a default <xref:System.ServiceModel.WSHttpBinding> (the default <xref:System.ServiceModel.SecurityMode?displayProperty=fullName>, which is <xref:System.ServiceModel.SecurityMode>), all messages are encrypted and signed because this is the default protection level. However, when an `ISampleService` service is used with a default <xref:System.ServiceModel.BasicHttpBinding> (the default <xref:System.ServiceModel.SecurityMode>, which is <xref:System.ServiceModel.SecurityMode>), all messages are sent as text because there is no security for this binding and so the protection level is ignored (that is, the messages are neither encrypted nor signed). If the <xref:System.ServiceModel.SecurityMode> was changed to <xref:System.ServiceModel.SecurityMode>, then these messages would be encrypted and signed (because that would now be the binding's default protection level).
Expand Down Expand Up @@ -255,7 +250,6 @@ Public Interface IExplicitProtectionLevelSampleService
End Function

End Interface

```

A service that implements this `IExplicitProtectionLevelSampleService` contract and has an endpoint that uses the default <xref:System.ServiceModel.WSHttpBinding> (the default <xref:System.ServiceModel.SecurityMode?displayProperty=fullName>, which is <xref:System.ServiceModel.SecurityMode>) has the following behavior:
Expand Down
10 changes: 4 additions & 6 deletions docs/framework/wcf/feature-details/using-message-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public class BankingTransaction

In this example, the `IsAudited` header is in the namespace specified in the code, and the body part that represents the `theData` member is represented by an XML element with the name `transactionData`. The following shows the XML generated for this message contract.

```
```xml
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:IsAudited xmlns:h="http://schemas.contoso.com/auditing/2005" xmlns="http://schemas.contoso.com/auditing/2005">false</h:IsAudited>
Expand Down Expand Up @@ -183,7 +183,7 @@ public class BankingDepositLog

This results in SOAP headers is similar to the following.

```
```xml
<BankingDepositLog>
<numRecords>3</numRecords>
<records>
Expand All @@ -197,8 +197,7 @@ public class BankingDepositLog

An alternative to this is to use the <xref:System.ServiceModel.MessageHeaderArrayAttribute>. In this case, each array element is serialized independently and so that each array element has one header, similar to the following.

```

```xml
<numRecords>3</numRecords>
<records>Record1</records>
<records>Record2</records>
Expand Down Expand Up @@ -291,8 +290,7 @@ bt.IsAudited.MustUnderstand=true;

If you use both the dynamic and the static control mechanisms, the static settings are used as a default but can later be overridden by using the dynamic mechanism, as shown in the following code.

```
[C#]
```csharp
[MessageHeader(MustUnderstand=true)] public MessageHeader<Person> documentApprover;
// later on in the code:
BankingTransaction bt = new BankingTransaction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ The Windows Forms <xref:System.Windows.Forms.NotifyIcon> component displays a si

In the following code example, the path set for the location of the icon is the **My Documents** folder. This location is used because you can assume that most computers running the Windows operating system will include this folder. Choosing this location also enables users with minimal system access levels to safely run the application. The following example requires a form with a <xref:System.Windows.Forms.NotifyIcon> control already added. It also requires an icon file named `Icon.ico`.

[Visual Basic]

```
```vb
' You should replace the bold icon in the sample below
' with an icon of your own choosing.
NotifyIcon1.Icon = New _
Expand All @@ -51,12 +49,9 @@ The Windows Forms <xref:System.Windows.Forms.NotifyIcon> component displays a si
& "\Icon.ico")
NotifyIcon1.Visible = True
NotifyIcon1.Text = "Antivirus program"

```

[C#]

```
```csharp
// You should replace the bold icon in the sample below
// with an icon of your own choosing.
// Note the escape character used (@) when specifying the path.
Expand All @@ -66,12 +61,9 @@ The Windows Forms <xref:System.Windows.Forms.NotifyIcon> component displays a si
+ @"\Icon.ico");
notifyIcon1.Visible = true;
notifyIcon1.Text = "Antivirus program";

```

[cpp]

```
```cpp
// You should replace the bold icon in the sample below
// with an icon of your own choosing.
notifyIcon1->Icon = gcnew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@ manager: "wpickett"
MyBase.OnRenderItemText(e)
End Sub
End Class

```

[C#]

```
```csharp
public class RedTextRenderer : _
System.Windows.Forms.ToolStripRenderer
{
Expand All @@ -63,7 +60,6 @@ manager: "wpickett"
base.OnRenderItemText(e);
}
}

```

### To set the custom renderer to be the current renderer
Expand All @@ -72,30 +68,22 @@ manager: "wpickett"

```vb
toolStrip1.Renderer = New RedTextRenderer()

```

[C#]

```
```csharp
toolStrip1.Renderer = new RedTextRenderer();

```

2. Or to set the custom renderer for all <xref:System.Windows.Forms.ToolStrip> classes contained in your application: Set the <xref:System.Windows.Forms.ToolStripManager.Renderer%2A?displayProperty=fullName> property to the custom renderer and set the <xref:System.Windows.Forms.ToolStrip.RenderMode%2A> property to <xref:System.Windows.Forms.ToolStripRenderMode>.

```vb
toolStrip1.RenderMode = ToolStripRenderMode.ManagerRenderMode
ToolStripManager.Renderer = New RedTextRenderer()

```

[C#]

```
```csharp
toolStrip1.RenderMode = ToolStripRenderMode.ManagerRenderMode;
ToolStripManager.Renderer = new RedTextRenderer();

```

## See Also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ You can enhance the usability of <xref:System.Windows.Forms.MenuStrip> and <xref

- After you define your <xref:System.Windows.Forms.MenuStrip> and the items it will contain, use the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> or <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method to add the menu commands and <xref:System.Windows.Forms.ToolStripSeparator> controls to the <xref:System.Windows.Forms.MenuStrip> in the order you want.

[Visual Basic]

```
```vb
' This code adds a top-level File menu to the MenuStrip.
Me.menuStrip1.Items.Add(New ToolStripMenuItem() _
{Me.fileToolStripMenuItem})
Expand All @@ -101,12 +99,9 @@ You can enhance the usability of <xref:System.Windows.Forms.MenuStrip> and <xref
ToolStripMenuItem() {Me.newToolStripMenuItem, _
Me.openToolStripMenuItem, Me.toolStripSeparator1, _
Me.saveToolStripMenuItem, Me.exitToolStripMenuItem})

```

[C#]

```
```csharp
// This code adds a top-level File menu to the MenuStrip.
this.menuStrip1.Items.Add(new ToolStripItem[]_
{this.fileToolStripMenuItem});
Expand Down
Loading