Skip to content

Commit da17f26

Browse files
Merge pull request #11850 from dotnet/main
Merge main into live
2 parents 2289128 + 017f8e8 commit da17f26

File tree

7 files changed

+31
-27
lines changed

7 files changed

+31
-27
lines changed

snippets/csharp/System.Xml.Serialization/XmlSerializer/FromTypes/Project.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
</PropertyGroup>
7-
8-
</Project>
7+
8+
</Project>

snippets/csharp/System.Xml.Serialization/XmlSerializer/FromTypes/source.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,24 @@ public class Test
2525
{
2626
public static void Main()
2727
{
28-
Test t = new Test();
28+
Test t = new();
2929
t.GetSerializers();
3030
}
3131

3232
public void GetSerializers()
3333
{
3434
// Create an array of types.
35-
Type[]types = new Type[3];
36-
types[0] = typeof(Instrument);
37-
types[1] = typeof(Player);
38-
types[2] = typeof(Piece);
35+
Type[] types = [typeof(Instrument), typeof(Player), typeof(Piece)];
3936

4037
// Create an array for XmlSerializer objects.
41-
XmlSerializer[]serializers= new XmlSerializer[3];
38+
XmlSerializer[] serializers = new XmlSerializer[3];
4239
serializers = XmlSerializer.FromTypes(types);
4340
// Create one Instrument and serialize it.
4441
Instrument i = new Instrument();
4542
i.InstrumentName = "Piano";
4643
// Create a TextWriter to write with.
4744
TextWriter writer = new StreamWriter("Inst.xml");
48-
serializers[0].Serialize(writer,i);
45+
serializers[0].Serialize(writer, i);
4946
writer.Close();
5047
}
5148
}
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>Library</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>

snippets/visualbasic/System.Xml.Serialization/XmlSerializer/FromTypes/source.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
Imports System.IO
33
Imports System.Xml.Serialization
44

5-
65
' Three classes are included here. Each one will
7-
' be used to create three XmlSerializer objects.
6+
' be used to create three XmlSerializer objects.
87

98
Public Class Instrument
109
Public InstrumentName As String
@@ -19,19 +18,19 @@ Public Class Piece
1918
End Class
2019

2120
Public Class Test
22-
21+
2322
Public Shared Sub Main()
2423
Dim t As New Test()
2524
t.GetSerializers()
26-
End Sub
27-
25+
End Sub
26+
2827
Public Sub GetSerializers()
2928
' Create an array of types.
3029
Dim types(3) As Type
3130
types(0) = GetType(Instrument)
3231
types(1) = GetType(Player)
3332
types(2) = GetType(Piece)
34-
33+
3534
' Create an array for XmlSerializer objects.
3635
Dim serializers(3) As XmlSerializer
3736
serializers = XmlSerializer.FromTypes(types)
@@ -45,4 +44,4 @@ Public Class Test
4544
End Sub
4645
End Class
4746

48-
' </Snippet1>
47+
' </Snippet1>

xml/System.Xml.Serialization/XmlSerializer.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,15 +1897,15 @@ The following example contains two main classes: `PurchaseOrder` and `Test`. The
18971897
<format type="text/markdown"><![CDATA[
18981898
18991899
## Remarks
1900-
The <xref:System.Xml.Serialization.XmlSerializer.FromTypes%2A> method allows you to efficiently create an array of <xref:System.Xml.Serialization.XmlSerializer> objects for processing an array of <xref:System.Type> objects. However, it is recommended for callers to cache the returned serializers when there are repeated calls to this method.
1901-
19021900
1901+
The <xref:System.Xml.Serialization.XmlSerializer.FromTypes%2A> method allows you to efficiently create an array of <xref:System.Xml.Serialization.XmlSerializer> objects for processing an array of <xref:System.Type> objects. However, it's recommended for callers to cache the returned serializers when there are repeated calls to this method.
19031902
19041903
## Examples
1905-
The following example uses the <xref:System.Xml.Serialization.XmlSerializer.FromTypes%2A> method to return an array of <xref:System.Xml.Serialization.XmlSerializer> objects. The code includes three class definitions that are each used to create an array of <xref:System.Type> objects.
19061904
1907-
:::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlSerializer/FromTypes/source.cs" id="Snippet1":::
1908-
:::code language="vb" source="~/snippets/visualbasic/System.Xml.Serialization/XmlSerializer/FromTypes/source.vb" id="Snippet1":::
1905+
The following example uses the <xref:System.Xml.Serialization.XmlSerializer.FromTypes%2A> method to return an array of <xref:System.Xml.Serialization.XmlSerializer> objects. The code includes three class definitions that are each used to create an array of <xref:System.Type> objects.
1906+
1907+
:::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/XmlSerializer/FromTypes/source.cs" id="Snippet1":::
1908+
:::code language="vb" source="~/snippets/visualbasic/System.Xml.Serialization/XmlSerializer/FromTypes/source.vb" id="Snippet1":::
19091909
19101910
]]></format>
19111911
</remarks>

xml/System/AppDomain.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8821,7 +8821,10 @@ The friendly name of the default application domain is the file name of the proc
88218821
</ReturnValue>
88228822
<Docs>
88238823
<summary>Occurs when an exception is not caught.</summary>
8824-
<remarks>For more information about this API, see <see href="/dotnet/fundamentals/runtime-libraries/system-appdomain-unhandledexception">Supplemental API remarks for UnhandledException</see>.</remarks>
8824+
<remarks>
8825+
Handlers may be invoked multiple times if exceptions are thrown from different threads.
8826+
8827+
For more information about this API, see <see href="/dotnet/fundamentals/runtime-libraries/system-appdomain-unhandledexception">Supplemental API remarks for UnhandledException</see>.</remarks>
88258828
<example>
88268829
<format type="text/markdown"><![CDATA[
88278830
The following example demonstrates the <xref:System.AppDomain.UnhandledException> event. It defines an event handler, `MyHandler`, that is invoked whenever an unhandled exception is thrown in the default application domain. It then throws two exceptions. The first is handled by a **try/catch** block. The second is unhandled and invokes the `MyHandle` routine before the application terminates.

xml/System/String.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12841,14 +12841,11 @@ Note that the method is called with the `options` argument set to <xref:System.S
1284112841
<param name="separator">A character that delimits the substrings in this instance.</param>
1284212842
<param name="count">The maximum number of elements expected in the array.</param>
1284312843
<param name="options">A bitwise combination of the enumeration values that specifies whether to trim substrings and include empty substrings.</param>
12844-
<summary>Splits a string into a maximum number of substrings based on a specified delimiting character and, optionally, options.
12845-
Splits a string into a maximum number of substrings based on the provided character separator, optionally omitting empty substrings from the result.</summary>
12844+
<summary>Splits a string into a maximum number of substrings based on the provided character separator, optionally omitting empty substrings from the result.</summary>
1284612845
<returns>An array that contains at most <paramref name="count" /> substrings from this instance that are delimited by <paramref name="separator" />.</returns>
1284712846
<remarks>
1284812847
<format type="text/markdown"><![CDATA[
1284912848

12850-
## Remarks
12851-
1285212849
If the string has already been split `count` - 1 times, but the end of the string has not been reached, then the last string in the returned array will contain this instance's remaining trailing substring, untouched.
1285312850

1285412851
]]></format>

0 commit comments

Comments
 (0)