Skip to content

Commit 3774ce2

Browse files
authored
Code example cleanup (#11234)
1 parent 80358d2 commit 3774ce2

File tree

7 files changed

+34
-27
lines changed

7 files changed

+34
-27
lines changed

xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
4444
INI files are simple line structures ([INI Files on Wikipedia](https://en.wikipedia.org/wiki/INI_file)). The following example demonstrates a structure of the INI file:
4545
46-
```
46+
```ini
4747
[Section:Header]
4848
key1=value1
4949
key2 = " value2 "

xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ The <xref:Microsoft.Extensions.DependencyInjection.PollyHttpClientBuilderExtensi
3636
<xref:Microsoft.Extensions.Http.PolicyHttpMessageHandler> and the <xref:Microsoft.Extensions.DependencyInjection.PollyHttpClientBuilderExtensions> convenience methods only accept the generic <xref:Polly.IAsyncPolicy`1>. Generic policy instances can be created by using the generic methods on <xref:Polly.Policy> such as <xref:Polly.Policy.TimeoutAsync``1(System.Int32)>.
3737
3838
To adapt an existing non-generic <xref:Polly.IAsyncPolicy>, use code like the following:
39-
40-
```
39+
40+
```csharp
4141
policy.AsAsyncPolicy&lt;HttpResponseMessage&gt;()
4242
```
4343

xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
This attribute can be used to annotate a `struct` type with a single field. The runtime replicates that field in the actual type layout as many times as is specified.
3636
3737
> [!IMPORTANT]
38-
> .NET 9 and later, the default implementations of `Equals()` and `GetHashCode()` for types marked with this attribute throw <xref:System.NotSupportedException>. You must override both <xref:System.ValueType.Equals(System.Object)> and <xref:System.ValueType.GetHashCode%2A> if they will be used.
38+
> In .NET 9 and later versions, the default implementations of `Equals()` and `GetHashCode()` for types marked with this attribute throw <xref:System.NotSupportedException>. You must override both <xref:System.ValueType.Equals(System.Object)> and <xref:System.ValueType.GetHashCode%2A> if they will be used.
3939
4040
]]></format>
4141
</remarks>
@@ -46,7 +46,8 @@ This attribute can be used to annotate a `struct` type with a single field. The
4646
{
4747
private float _value;
4848
}
49-
</code></example>
49+
</code>
50+
</example>
5051
</Docs>
5152
<Members>
5253
<Member MemberName=".ctor">

xml/System.Runtime.InteropServices.Swift/SwiftError.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
</Attributes>
2727
<Docs>
2828
<summary>Represents the Swift error context, indicating that the argument is the error context.</summary>
29-
<remarks>
30-
<para> This struct is used to retrieve the 'error' context from Swift functions in the context of interop with .NET.
31-
</para>
32-
<para> Here's an example of how a SwiftError can be declared:
33-
<code lang="csharp"> [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [DllImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftError* error); </code></para>
34-
</remarks>
29+
<remarks>This struct is used to retrieve the 'error' context from Swift functions in the context of interop with .NET.</remarks>
30+
<example>Here's an example of how a SwiftError can be declared:
31+
<code lang="csharp">
32+
[UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])]
33+
[DllImport("SwiftLibrary", EntryPoint = "export")]
34+
public static extern void swiftFunction(SwiftError* error);
35+
</code>
36+
</example>
3537
</Docs>
3638
<Members>
3739
<Member MemberName=".ctor">

xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
</Attributes>
2727
<Docs>
2828
<summary>Represents the Swift return buffer context.</summary>
29-
<remarks>This struct is used to access the return buffer when interoping with Swift functions that return non-frozen structs.
30-
It provides a pointer to the memory location where the result should be stored.</remarks>
29+
<remarks>This struct is used to access the return buffer when interoping with Swift functions that return non-frozen structs. It provides a pointer to the memory location where the result should be stored.</remarks>
3130
<example>Here's an example of how a SwiftIndirectResult can be declared:
32-
<code lang="csharp">
31+
<code lang="csharp">
3332
[UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])]
3433
[LibraryImport("SwiftLibrary", EntryPoint = "export")]
3534
public static extern void swiftFunction(SwiftIndirectResult result);
36-
</code></example>
35+
</code>
36+
</example>
3737
</Docs>
3838
<Members>
3939
<Member MemberName=".ctor">

xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
</Attributes>
2727
<Docs>
2828
<summary>Represents the Swift 'self' context, indicating that the argument is the self context.</summary>
29-
<remarks>
30-
<para> This struct is used to pass the 'self' context to Swift functions in the context of interop with .NET.
31-
</para>
32-
<para> Here's an example of how a SwiftSelf context can be declared:
33-
<code lang="csharp"> [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [DllImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftSelf self); </code></para>
34-
</remarks>
29+
<remarks>This struct is used to pass the 'self' context to Swift functions in the context of interop with .NET.</remarks>
30+
<example>Here's an example of how a SwiftSelf context can be declared:
31+
<code lang="csharp">
32+
[UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])]
33+
[DllImport("SwiftLibrary", EntryPoint = "export")]
34+
public static extern void swiftFunction(SwiftSelf self);
35+
</code>
36+
</example>
3537
</Docs>
3638
<Members>
3739
<Member MemberName=".ctor">

xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@
3838
<Docs>
3939
<typeparam name="T">The type of the frozen struct to pass in the 'self' context.</typeparam>
4040
<summary>Represents the Swift 'self' context when the argument is Swift frozen struct T, which is either enregistered into multiple registers, or passed by reference in the 'self' register.</summary>
41-
<remarks>
42-
<para> This struct is used to pass the Swift frozen struct T to Swift functions in the context of interop with .NET.
43-
</para>
44-
<para> Here's an example of how a SwiftSelf&lt;T&gt; context can be declared:
45-
<code lang="csharp"> [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [LibraryImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftSelf&lt;T&gt; self); </code></para>
46-
</remarks>
41+
<remarks>This struct is used to pass the Swift frozen struct T to Swift functions in the context of interop with .NET.</remarks>
42+
<example>Here's an example of how a SwiftSelf&lt;T&gt; context can be declared:
43+
<code lang="csharp">
44+
[UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])]
45+
[LibraryImport("SwiftLibrary", EntryPoint = "export")]
46+
public static extern void swiftFunction(SwiftSelf&lt;T&gt; self);
47+
</code>
48+
</example>
4749
</Docs>
4850
<Members>
4951
<Member MemberName=".ctor">

0 commit comments

Comments
 (0)