Skip to content

Commit 6480302

Browse files
Merge pull request #10400 from dotnet/main
Merge main into live
2 parents 8bb175d + ec4f911 commit 6480302

File tree

12 files changed

+190
-117
lines changed

12 files changed

+190
-117
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//Example1.Main();
2+
//Example2.Main();
3+
//Example3.Main();
4+
Example4.Main();
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>

snippets/csharp/System/String/Replace/replace1.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using System;
22

3-
public class Example
3+
public class Example1
44
{
55
public static void Main()
66
{
77
// <Snippet1>
8-
String s = "aaa";
9-
Console.WriteLine("The initial string: '{0}'", s);
8+
string s = "aaa";
9+
Console.WriteLine($"The initial string: '{s}'");
1010
s = s.Replace("a", "b").Replace("b", "c").Replace("c", "d");
11-
Console.WriteLine("The final string: '{0}'", s);
11+
Console.WriteLine($"The final string: '{s}'");
1212

1313
// The example displays the following output:
1414
// The initial string: 'aaa'

snippets/csharp/System/String/Replace/replace2.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using System;
22

3-
public class Example
3+
public class Example2
44
{
55
public static void Main()
66
{
77
// <Snippet2>
8-
String s = new String('a', 3);
9-
Console.WriteLine("The initial string: '{0}'", s);
8+
string s = new('a', 3);
9+
Console.WriteLine($"The initial string: '{s}'");
1010
s = s.Replace('a', 'b').Replace('b', 'c').Replace('c', 'd');
11-
Console.WriteLine("The final string: '{0}'", s);
11+
Console.WriteLine($"The final string: '{s}'");
1212

1313
// The example displays the following output:
1414
// The initial string: 'aaa'

snippets/csharp/System/String/Replace/string.replace1.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using System;
22

3-
class stringReplace1 {
4-
public static void Main() {
3+
class Example3
4+
{
5+
public static void Main()
6+
{
57
//<snippet1>
6-
String str = "1 2 3 4 5 6 7 8 9";
7-
Console.WriteLine("Original string: \"{0}\"", str);
8-
Console.WriteLine("CSV string: \"{0}\"", str.Replace(' ', ','));
8+
string str = "1 2 3 4 5 6 7 8 9";
9+
Console.WriteLine($"Original string: \"{str}\"");
10+
Console.WriteLine($"CSV string: \"{str.Replace(' ', ',')}\"");
911

1012
// This example produces the following output:
1113
// Original string: "1 2 3 4 5 6 7 8 9"

snippets/csharp/System/String/Replace/stringreplace.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
using System;
22

3-
public class ReplaceTest
3+
public class Example4
44
{
55
public static void Main()
66
{
7-
87
//<snippet1>
98
string errString = "This docment uses 3 other docments to docment the docmentation";
109

11-
Console.WriteLine("The original string is:{0}'{1}'{0}", Environment.NewLine, errString);
10+
Console.WriteLine($"The original string is:{Environment.NewLine}'{errString}'{Environment.NewLine}");
1211

1312
// Correct the spelling of "document".
14-
1513
string correctString = errString.Replace("docment", "document");
1614

17-
Console.WriteLine("After correcting the string, the result is:{0}'{1}'",
18-
Environment.NewLine, correctString);
15+
Console.WriteLine($"After correcting the string, the result is:{Environment.NewLine}'{correctString}'");
1916

2017
// This code example produces the following output:
2118
//

xml/System.Buffers.Text/Utf8Parser.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,16 @@
7171
</Parameters>
7272
<Docs>
7373
<param name="source">The Utf8 string to parse.</param>
74-
<param name="value">When the method returns, contains the value parsed from <paramref name="source" />, if the parsing operation succeeded. </param>
74+
<param name="value">When the method returns, contains the value parsed from <paramref name="source" />, if the parsing operation succeeded.</param>
7575
<param name="bytesConsumed">If the parsing operation was successful, contains the length in bytes of the parsed substring when the method returns. If the method fails, <paramref name="bytesConsumed" /> is set to 0.</param>
76-
<param name="standardFormat">The expected format of the Utf8 string.</param>
76+
<param name="standardFormat">The expected format of the Utf8 string. Supported formats are <c>'G'</c>, <c>'l'</c>, and <c>default</c>.</param>
7777
<summary>Parses a <see cref="T:System.Boolean" /> at the start of a Utf8 string.</summary>
7878
<returns>
7979
<see langword="true" /> for success; <see langword="false" /> if the string was not syntactically valid or an overflow or underflow occurred.</returns>
8080
<remarks>
8181
<format type="text/markdown"><![CDATA[
8282
83-
Formats supported:
84-
85-
|Format string|Example expected format|
86-
|--|--|
87-
|G (default)|True/False|
88-
|l|true/false|
83+
The parsing is case insensitive. The format parameter is validated to ensure it is supported; however, all supported formats are treated identically.
8984
9085
]]></format>
9186
</remarks>

xml/System.Windows/Application.xml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,9 +2476,28 @@ This example illustrates how to use XAML together with application-scope resourc
24762476
<ReturnType>System.Windows.ThemeMode</ReturnType>
24772477
</ReturnValue>
24782478
<Docs>
2479-
<summary>To be added.</summary>
2479+
<summary>Gets or sets the Fluent theme mode of the application.</summary>
24802480
<value>To be added.</value>
2481-
<remarks>To be added.</remarks>
2481+
<remarks>
2482+
<para>Setting this property controls if Fluent theme is loaded in Light, Dark or System mode.</para>
2483+
<para>It also controls the application of backdrop and darkmode on window.</para>
2484+
<para>The four values for the ThemeMode enum are :</para>
2485+
<para>
2486+
<see cref="P:System.Windows.ThemeMode.None" /> - No Fluent theme is loaded.</para>
2487+
<para>
2488+
<see cref="P:System.Windows.ThemeMode.System" /> - Fluent theme is loaded based on the system theme.</para>
2489+
<para>
2490+
<see cref="P:System.Windows.ThemeMode.Light" /> - Fluent theme is loaded in Light mode.</para>
2491+
<para>
2492+
<see cref="P:System.Windows.ThemeMode.Dark" /> - Fluent theme is loaded in Dark mode.</para>
2493+
<para>These values are predefined in <see cref="P:System.Windows.Application.ThemeMode" /> struct The default value is <see cref="P:System.Windows.ThemeMode.None" />.</para>
2494+
<para>
2495+
<see cref="P:System.Windows.Application.ThemeMode" /> and <see cref="P:System.Windows.Application.Resources" /> are designed to be in sync with each other.</para>
2496+
<para>Syncing is done in order to avoid UI inconsistencies, where the window is in dark mode but the controls within are in light mode or vice versa.</para>
2497+
<para>Setting this property loads the Fluent theme dictionaries in the application resources.</para>
2498+
<para>So, if you set this property, it is preferrable to not include Fluent theme dictionaries in the application resources manually. If you do, the Fluent theme dictionaries added in the application resources will take precedence over the ones added by setting this property.</para>
2499+
<para>This property is experimental and may be removed in future versions.</para>
2500+
</remarks>
24822501
</Docs>
24832502
</Member>
24842503
<Member MemberName="TryFindResource">

0 commit comments

Comments
 (0)