Skip to content

Commit c3407af

Browse files
committed
Try markdown formatting
1 parent ce3b258 commit c3407af

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

xml/System.Diagnostics.CodeAnalysis/FeatureGuardAttribute.xml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,26 @@
4040
call to the property.</para>
4141
</remarks>
4242
<example>
43-
<code language="csharp">
44-
if (Feature.IsSupported)
45-
Feature.Implementation();
43+
<format type="text/markdown"><![CDATA[
44+
```csharp
45+
if (Feature.IsSupported)
46+
Feature.Implementation();
4647
47-
public class Feature
48-
{
49-
[FeatureGuard(typeof(RequiresDynamicCodeAttribute))]
50-
internal static bool IsSupported => RuntimeFeature.IsDynamicCodeSupported;
48+
public class Feature
49+
{
50+
[FeatureGuard(typeof(RequiresDynamicCodeAttribute))]
51+
internal static bool IsSupported => RuntimeFeature.IsDynamicCodeSupported;
5152
52-
[RequiresDynamicCode("Feature requires dynamic code support.")]
53-
internal static Implementation() => ...; // Uses dynamic code
54-
}
55-
</code>
56-
When the app is built with `&lt;PublishAot&gt;true&lt;PublishAot&gt;`, the call to
57-
`Feature.Implementation()` doesn't produce analyzer warning
58-
<see href="/dotnet/core/deploying/native-aot/warnings/il3050">IL3050</see>,
59-
and `Feature.Implementation` code is removed when publishing.
53+
[RequiresDynamicCode("Feature requires dynamic code support.")]
54+
internal static Implementation() => ...; // Uses dynamic code
55+
}
56+
```
57+
58+
When the app is built with `<PublishAot>true</PublishAot>`, the call to
59+
`Feature.Implementation()` doesn't produce analyzer warning
60+
[IL3050](/dotnet/core/deploying/native-aot/warnings/il3050)
61+
and `Feature.Implementation` code is removed when publishing.
62+
]]></format>
6063
</example>
6164
</Docs>
6265
<Members>

xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,27 @@
3939
of the specified property with the value of the feature switch.</para>
4040
</remarks>
4141
<example>
42-
<code language="csharp">
43-
if (Feature.IsSupported)
44-
Feature.Implementation();
42+
<format type="text/markdown"><![CDATA[
43+
```csharp
44+
if (Feature.IsSupported)
45+
Feature.Implementation();
4546
46-
public class Feature
47-
{
48-
[FeatureSwitchDefinition("Feature.IsSupported")]
49-
internal static bool IsSupported => AppContext.TryGetSwitch("Feature.IsSupported", out bool isEnabled) ? isEnabled : true;
47+
public class Feature
48+
{
49+
[FeatureSwitchDefinition("Feature.IsSupported")]
50+
internal static bool IsSupported => AppContext.TryGetSwitch("Feature.IsSupported", out bool isEnabled) ? isEnabled : true;
5051
51-
internal static Implementation() => ...;
52-
}
53-
</code>
54-
When the app is trimmed with the following feature settings in the project file,
55-
`Feature.IsSupported` is treated as `false`, and `Feature.Implementation` code is removed.
56-
<code language="xml">
57-
&lt;ItemGroup&gt;
58-
&lt;RuntimeHostConfigurationOption Include="Feature.IsSupported" Value="false" /&gt;
59-
&lt;/ItemGroup&gt;
60-
</code>
52+
internal static Implementation() => ...;
53+
}
54+
`
55+
When the app is trimmed with the following feature settings in the project file,
56+
`Feature.IsSupported` is treated as `false`, and `Feature.Implementation` code is removed.
57+
```xml
58+
<ItemGroup>
59+
<RuntimeHostConfigurationOption Include="Feature.IsSupported" Value="false" />
60+
</ItemGroup>
61+
```
62+
]]></format>
6163
</example>
6264
</Docs>
6365
<Members>

0 commit comments

Comments
 (0)