Skip to content

Add language slugs (System.IO) #11227

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 25, 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
12 changes: 5 additions & 7 deletions xml/System.Globalization/CultureInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1270,21 +1270,19 @@ You might choose to override some of the values associated with the current cult
<format type="text/markdown"><![CDATA[

## Remarks
In the .NET Framework 4 and previous versions, by default, the UI culture of all threads is set to the Windows system culture. For applications whose current UI culture differs from the default system culture, this behavior is often undesirable. In the .NET Framework 4.5, the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property lets you define the default UI culture of all threads in an application domain.
In the .NET Framework 4 and previous versions, by default, the UI culture of all threads is set to the Windows system culture. For applications whose current UI culture differs from the default system culture, this behavior is often undesirable. In .NET Framework 4.5+, the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property lets you define the default UI culture of all threads in an application domain.

> [!IMPORTANT]
> If you have not explicitly set the UI culture of any existing threads executing in an application domain, setting the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property also changes the culture of these threads. However, if these threads execute in another application domain, their culture is defined by the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property in that application domain or, if no default value is defined, by the default system culture. Because of this, we recommend that you always explicitly set the culture of your main application thread and do not rely on the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property to define the culture of the main application thread.

Unless it is set explicitly, the value of the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property is `null`, and the current culture of all threads in an application domain that have not been assigned an explicit culture is defined by the default Windows system culture.

For more information about cultures, threads, and application domains, see the "Culture and threads" and "Culture and application domains" sections in the <xref:System.Globalization.CultureInfo> reference page.


For more information about cultures, threads, and application domains, see the "Culture and threads" and "Culture and application domains" sections of <xref:System.Globalization.CultureInfo>.

## Examples
The following example illustrates the default behavior of the .NET Framework in defining the current culture of a new thread. It uses English and Russian language resources. The following text file named GreetingStrings.txt contains the English language resources:
The following example illustrates the default behavior of .NET in defining the current culture of a new thread. It uses English and Russian language resources. The following text file named GreetingStrings.txt contains the English language resources:

```
```txt
greeting =Hello again!
newGreeting=Hello!
```
Expand All @@ -1297,7 +1295,7 @@ resgen greetingstrings.txt

The following text file named GreetingStrings.ru-RU.txt contains the Russian language resources:

```
```txt
greeting=Еще раз привет!
newGreeting=Привет!
```
Expand Down
35 changes: 12 additions & 23 deletions xml/System.IO.MemoryMappedFiles/MemoryMappedFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -896,38 +896,27 @@
## Remarks
Use this method to create a memory-mapped file that is not persisted (that is, not associated with a file on disk), which you can use to share data between processes.



## Examples
The following example is composed of three separate processes (console applications) that write `Boolean` values to a memory-mapped file. The following sequence of actions occur:

1. Process A creates the memory-mapped file and writes a value to it.

2. Process B opens the memory-mapped file and writes a value to it.

3. Process C opens the memory-mapped file and writes a value to it.

4. Process A reads and displays the values from the memory-mapped file.

5. After Process A is finished with the memory-mapped file, the file is immediately reclaimed by garbage collection.
1. Process A creates the memory-mapped file and writes a value to it.
2. Process B opens the memory-mapped file and writes a value to it.
3. Process C opens the memory-mapped file and writes a value to it.
4. Process A reads and displays the values from the memory-mapped file.
5. After Process A is finished with the memory-mapped file, the file is immediately reclaimed by garbage collection.

To run this example, do the following:

1. Compile the applications and open three Command windows.

2. In the first Command window, run Process A.

3. In the second Command window, run Process B.

4. Return to Process A and press ENTER.

5. In the third Command window, run Process C.

6. Return to Process A and press ENTER.
1. Compile the applications and open three Command windows.
2. In the first Command window, run Process A.
3. In the second Command window, run Process B.
4. Return to Process A and press ENTER.
5. In the third Command window, run Process C.
6. Return to Process A and press ENTER.

The output of Process A is as follows:

```
```txt
Start Process B and press ENTER to continue.
Start Process C and press ENTER to continue.
Process A says: True
Expand Down
28 changes: 0 additions & 28 deletions xml/System.IO/BufferedStream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -743,34 +743,6 @@ Flushing the stream will not flush its underlying encoder unless you explicitly

Attempting to manipulate a stream after it has been closed might throw an <xref:System.ObjectDisposedException>.

## Examples
This code example is part of a larger example provided for the <xref:System.IO.BufferedStream> class.

```vb
' When bufStream is closed, netStream is in turn
' closed, which in turn shuts down the connection
' and closes clientSocket.
Console.WriteLine(vbCrLf & "Shutting down the connection.")
bufStream.Close()
```

```csharp
// When bufStream is closed, netStream is in turn
// closed, which in turn shuts down the connection
// and closes clientSocket.
Console.WriteLine("\nShutting down the connection.");
bufStream.Close();
```

```cpp
// When bufStream is closed, netStream is in turn closed,
// which in turn shuts down the connection and closes
// clientSocket.
Console::WriteLine( "\nShutting down connection." );
bufStream->Close();

```

]]></format>
</remarks>
<exception cref="T:System.IO.IOException">An error occurred while trying to close the stream.</exception>
Expand Down
2 changes: 1 addition & 1 deletion xml/System.IO/FileInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

This example produces output similar to the following.

```
```txt
Hello
And
Welcome
Expand Down
2 changes: 1 addition & 1 deletion xml/System.IO/Path.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ Console.WriteLine(result);

This example produces output similar to the following.

```
```txt
C:\Users\UserName\AppData\Local\Temp\
```

Expand Down
Loading