Skip to content

Add language slugs (various areas) #11222

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
merged 1 commit into from
Apr 24, 2025
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 @@ -111,7 +111,6 @@
## Examples

```csharp

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");

Expand Down Expand Up @@ -175,7 +174,6 @@ foreach (UserPrincipal u in results)
## Examples

```csharp

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");

Expand Down Expand Up @@ -245,7 +243,6 @@ foreach (UserPrincipal u in results)
In an extended class, you might implement an advanced search filter for `LogonCount`:

```csharp

public class InetOrgPersonSearchFilter : AdvancedFilters
{
public InetOrgPersonSearchFilter(Principal p) : base(p) { }
Expand Down Expand Up @@ -293,7 +290,6 @@ public class InetOrgPersonSearchFilter : AdvancedFilters
## Examples

```csharp

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");

Expand Down Expand Up @@ -355,7 +351,6 @@ foreach (UserPrincipal u in results)
## Examples

```csharp

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");

Expand Down Expand Up @@ -419,7 +414,6 @@ foreach (UserPrincipal u in results)
## Examples

```csharp

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");

Expand Down Expand Up @@ -481,7 +475,6 @@ foreach (UserPrincipal u in results)
## Examples

```csharp

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@

A search is performed for all authenticable principals under the container "DC=adamApp1,DC=fabrikam,DC=com" that have not logged on to this ADAM instance for the last 45 days. The principals returned by the search are then deleted.

```
```csharp
PrincipalContext ctx = new PrincipalContext(
ContextType.ApplicationDirectory,
"adamHost1.fabrikam.com:5000",
Expand All @@ -748,7 +748,6 @@ foreach (Principal p in oldPrincipals)

oldPrincipals.Dispose();
ctx.Dispose();

```

]]></format>
Expand Down Expand Up @@ -1280,9 +1279,9 @@ ctx.Dispose();
## Examples
The following example code connects to the LDAP domain "fabrikam.com" with the username (administrator) and password (SecretPwd123) initialized in the <xref:System.DirectoryServices.AccountManagement.PrincipalContext> constructor.

A search is performed to find the user with name "John Smith" under the container specified in the <xref:System.DirectoryServices.AccountManagement.PrincipalContext> constructor: "CN=Users,DC=fabrikam,DC=com." If the user is found, a check is performed to determine whether this user's account has been locked out. If the account has been locked out, the code example unlocks the account.
A search is performed to find the user with name "John Smith" under the container specified in the <xref:System.DirectoryServices.AccountManagement.PrincipalContext> constructor: "CN=Users,DC=fabrikam,DC=com." If the user is found, a check is performed to determine whether this user's account has been locked out. If the account has been locked out, the code example unlocks the account.

```
```csharp
PrincipalContext ctx = new PrincipalContext(ContextType.Domain,
"fabrikam.com",
"CN=Users,DC=fabrikam,DC=com",
Expand Down
1 change: 0 additions & 1 deletion xml/System.DirectoryServices/DirectoryEntry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,6 @@ if (string.Compare(mySchemaEntry.Name,"container") == 0)
foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children)
Console.WriteLine(myChildDirectoryEntry.Path);
}

```

```cpp
Expand Down
2 changes: 1 addition & 1 deletion xml/System.EnterpriseServices/ServicedComponent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

To deploy this class as a configured COM component, you must generate a strong key, compile the class as a library, and register the library. These three steps are accomplished by the following three commands.

```
```console
sn -k Calculator.snk
csc /t:library Calculator.cs
regsvcs Calculator.dll
Expand Down
4 changes: 2 additions & 2 deletions xml/System.Messaging/DefaultPropertiesToSend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

There are two ways to define a queue's default properties to send, as shown in the following C# code. You can set values for this instance of <xref:System.Messaging.DefaultPropertiesToSend> and associate it with the queue's <xref:System.Messaging.MessageQueue.DefaultPropertiesToSend%2A?displayProperty=nameWithType> property:

```
```csharp
DefaultPropertiesToSend myDefaultProperties = new DefaultPropertiesToSend();
// Set default values for the properties.
myDefaultProperties.Label = "myLabel";
Expand All @@ -84,7 +84,7 @@ DefaultPropertiesToSend myDefaultProperties = new DefaultPropertiesToSend();

Or, you can individually assign values to the <xref:System.Messaging.MessageQueue> instance's <xref:System.Messaging.MessageQueue.DefaultPropertiesToSend%2A> property directly:

```
```csharp
myMessageQueue.DefaultPropertiesToSend.Label = "myLabel";
myMessageQueue.DefaultPropertiesToSend.Recoverable = false;
...
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Messaging/Message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@

Other formatters can provide binding functionality also, as shown in the following C# code.

```
```csharp
message.Formatter = new ActiveXMessageFormatter();
object myObject message.Body;
if (myObject is string) {
Expand Down
9 changes: 2 additions & 7 deletions xml/System.Messaging/MessageQueue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4117,13 +4117,8 @@ The name of the computer is not valid, possibly because the syntax is incorrect.
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Introduced in MSMQ 3.0. Gets or sets the multicast address associated with the queue.</summary>
<value>A <see cref="T:System.String" /> that contains a valid multicast address (in the form shown below) or <see langword="null" />, which indicates that the queue is not associated with a multicast address.

```
&lt;address&gt;:&lt;port&gt;
```
</value>
<summary>Gets or sets the multicast address associated with the queue.</summary>
<value>A valid multicast address (in the form &lt;address&gt;:&lt;port&gt;) or <see langword="null" />, which indicates that the queue is not associated with a multicast address.</value>
<remarks>
<format type="text/markdown"><![CDATA[

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
## Remarks
This overload enables you to use the `resourcesNamespace` parameter to specify the namespace for the generated resources. In this case, the generated code appears as follows:

```
```csharp
System.Resources.ResourceManager rm = new System.Resources.ResourceManager("<resourceNamespace>.<baseName>",typeof(baseName).Assembly);
```

Expand Down
2 changes: 1 addition & 1 deletion xml/System.Resources/ResXResourceReader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@

The resource XML file used by the example contains one data node and one metadata node. To use the XML file with the previous example, copy the following text and save it to a file named Resource1.resx.

```
```xml
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
Expand Down
23 changes: 7 additions & 16 deletions xml/System.Resources/ResourceManager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,9 @@


## Examples
The following example calls the <xref:System.Resources.ResourceManager.GetResourceSet%2A> method to retrieve culture-specific resources for the French (France) culture. It then enumerates all of the resources in the resource set. It contains the source code for an executable named ShowNumbers.exe. It also includes the following two text file that contain the names of numbers. The first, NumberResources.txt, contains the names of numbers from one to ten in the English language:

```
The following example calls the <xref:System.Resources.ResourceManager.GetResourceSet%2A> method to retrieve culture-specific resources for the French (France) culture. It then enumerates all of the resources in the resource set. It contains the source code for an executable named ShowNumbers.exe. The example includes two text files that contain the names of numbers. The first, NumberResources.txt, contains the names of numbers from one to ten in the English language:

```txt
one=one
two=two
three=three
Expand All @@ -907,24 +906,20 @@ seven=seven
eight=eight
nine=nine
ten=ten

```

The second, NumberResources.fr-FR.txt, contains the names of numbers from one to four in the French language:

```

```txt
one=un
two=deux
three=trois
four=quatre

```

You can use a batch file to generate the resource files, embed the English language resource file into the executable, and create a satellite assembly for the French language resources. Here's the batch file to generate an executable by using the Visual Basic compiler:

```

```bat
resgen NumberResources.txt
vbc shownumbers.vb /resource:NumberResources.resources

Expand All @@ -935,21 +930,19 @@ al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr

For the C# compiler, you can use the following batch file:

```

```bat
resgen NumberResources.txt
csc shownumbers.cs /resource:NumberResources.resources

md fr-FR
resgen NumberResources.fr-FR.txt
al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr-FR.resources

```

:::code language="csharp" source="~/snippets/csharp/System.Resources/ResourceManager/GetResourceSet/shownumbers.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.resources.resourcemanager.getresourceset/vb/shownumbers.vb" id="Snippet1":::

Note that if you change the value of the `createIfNotExists` argument to `false`, the method call returns `null`, since Resource Manager has not already loaded the French language resources.
If you change the value of the `createIfNotExists` argument to `false`, the method call returns `null`, since Resource Manager hasn't yet loaded the French language resources.

]]></format>
</remarks>
Expand Down Expand Up @@ -1128,15 +1121,13 @@ al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr

You can use the following batch file to build the C# example. For Visual Basic, change `csc` to `vbc`, and change the extension of the source code file from `.cs` to `.vb`.

```

```bat
csc CreateResources.cs
CreateResources

resgen AppResources.resx

csc GetStream.cs /resource:AppResources.resources

```

]]></format>
Expand Down
31 changes: 12 additions & 19 deletions xml/System.Resources/ResourceReader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@
[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)]

## Examples
The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application.

```
The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application.

```txt
Title="Top Pet Animal Clinic"
Label1="Patient Number:"
Label2="Pet Name:"
Expand All @@ -190,25 +190,24 @@ Label8="Address:"
Label9="Home Phone:"
Label10="Work Phone:"
Label11="Mobile Phone:"

```

You can compile the .txt file into a .resources file by issuing the following command:

**resgen PatientForm.txt**
`resgen PatientForm.txt`

The following example assumes that the resource file is embedded in the assembly that contains the application's executable code. It retrieves a resource file named `PatientForm.resources` from the currently executing assemblies and displays the name and value of each of its resources.

:::code language="csharp" source="~/snippets/csharp/System.Resources/ResourceReader/.ctor/stream1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.resources.resourcereader.ctor/vb/stream1.vb" id="Snippet1":::

If the C# example is named `Example.cs`, you can compile it by using the following command:
If the C# example is named `Example.cs`, you can compile it by using the following command:

**csc Example.cs /res:PatientForm.resources**
`csc Example.cs /res:PatientForm.resources`

If the Visual Basic example is named `Example.vb`, you can compile it by using the following command:
If the Visual Basic example is named `Example.vb`, you can compile it by using the following command:

**vbc Example.vb /res:PatientForm.resources**
`vbc Example.vb /res:PatientForm.resources`

]]></format>
</remarks>
Expand Down Expand Up @@ -279,8 +278,7 @@ Label11="Mobile Phone:"
## Examples
The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application.

```

```txt
Title="Top Pet Animal Clinic"
Label1="Patient Number:"
Label2="Pet Name:"
Expand All @@ -293,12 +291,11 @@ Label8="Address:"
Label9="Home Phone:"
Label10="Work Phone:"
Label11="Mobile Phone:"

```

You can compile this .txt file into a .resources file by issuing the following command:

**resgen PatientForm.txt**
`resgen PatientForm.txt`

The following example enumerates the resources in `PatientForm.resources` and displays the name and value of each.

Expand Down Expand Up @@ -514,15 +511,12 @@ Label11="Mobile Phone:"
You can handle the exception by calling the <xref:System.Resources.ResourceReader.GetResourceData%2A> method to retrieve information about the data type and the byte array assigned to the named resource. For more information, see the "Retrieving Resources by Name with GetResourceData" section in the <xref:System.Resources.ResourceReader> class topic.

> [!IMPORTANT]
> The <xref:System.Resources.ResourceReader> class includes two methods that return enumerators. The <xref:System.Resources.ResourceReader.GetEnumerator%2A> method returns an <xref:System.Collections.IDictionaryEnumerator> interface object and is the recommended method to call when enumerating resources.


> The <xref:System.Resources.ResourceReader> class includes two methods that return enumerators. The <xref:System.Resources.ResourceReader.GetEnumerator%2A> method returns an <xref:System.Collections.IDictionaryEnumerator> interface object and is the recommended method to call when enumerating resources.

## Examples
The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application.

```

```txt
Title="Top Pet Animal Clinic"
Label1="Patient Number:"
Label2="Pet Name:"
Expand All @@ -535,12 +529,11 @@ Label8="Address:"
Label9="Home Phone:"
Label10="Work Phone:"
Label11="Mobile Phone:"

```

You can compile the .txt file into a .resources file by issuing the following command:

**resgen PatientForm.txt**
`resgen PatientForm.txt`

The following example enumerates the resources in `PatientForm.resources` and displays the name and value of each.

Expand Down