|
54 | 54 | <Docs>
|
55 | 55 | <summary>Marks the program elements that are no longer in use. This class cannot be inherited.</summary>
|
56 | 56 | <remarks>
|
57 |
| - <format type="text/markdown"><. |
69 |
| - |
70 |
| -## [!INCLUDE[win8_appname_long](~/includes/win8-appname-long-md.md)] Apps |
71 |
| - When you create a Windows Metadata library (.winmd file), the <xref:System.ObsoleteAttribute> is exported as both the <xref:System.ObsoleteAttribute> attribute and the [Windows.Foundation.Metadata.DeprecatedAttribute](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecatedattribute.aspx) attribute if only the <xref:System.ObsoleteAttribute> is present in source code. The <xref:System.ObsoleteAttribute> is transformed to the `DeprecatedAttribute` as follows: |
72 |
| - |
73 |
| -- If the `message` and `error` arguments are both present, `message` is assigned to the `DeprecatedAttribute` `message` argument. An error value of `true` maps to [DeprecationType.Remove](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecationtype.aspx), and an `error` value of `false` maps to [DeprecationType.Deprecate](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecationtype.aspx). |
74 |
| - |
75 |
| -- If the `message` argument is not supplied in the <xref:System.ObsoleteAttribute>, its default value in the `DeprecatedAttribute` is "*element_name* is deprecated", where *element_name* is the name of the target program element to which the attribute is applied. |
76 |
| - |
77 |
| -- If the `error` argument is not present in the <xref:System.ObsoleteAttribute>, its default value in the `DeprecatedAttribute` is [DeprecationType.Deprecate](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecationtype.aspx). |
78 |
| - |
| 57 | + <format type="text/markdown"><. |
| 68 | +
|
| 69 | +## Windows 8.x Store apps |
| 70 | +
|
| 71 | + When you create a Windows Metadata library (.winmd file), the <xref:System.ObsoleteAttribute> is exported as both the <xref:System.ObsoleteAttribute> attribute and the [Windows.Foundation.Metadata.DeprecatedAttribute](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecatedattribute.aspx) attribute if only the <xref:System.ObsoleteAttribute> is present in source code. The <xref:System.ObsoleteAttribute> is transformed to the `DeprecatedAttribute` as follows: |
| 72 | +
|
| 73 | +- If the `message` and `error` arguments are both present, `message` is assigned to the `DeprecatedAttribute` `message` argument. An error value of `true` maps to [DeprecationType.Remove](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecationtype.aspx), and an `error` value of `false` maps to [DeprecationType.Deprecate](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecationtype.aspx). |
| 74 | +
|
| 75 | +- If the `message` argument is not supplied in the <xref:System.ObsoleteAttribute>, its default value in the `DeprecatedAttribute` is "*element_name* is deprecated", where *element_name* is the name of the target program element to which the attribute is applied. |
| 76 | +
|
| 77 | +- If the `error` argument is not present in the <xref:System.ObsoleteAttribute>, its default value in the `DeprecatedAttribute` is [DeprecationType.Deprecate](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecationtype.aspx). |
| 78 | +
|
79 | 79 | > [!IMPORTANT]
|
80 |
| -> Directly applying the [Windows.Foundation.Metadata.DeprecatedAttribute](https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecatedattribute.aspx) attribute to managed code is not recommended, because this export occurs automatically. |
81 |
| - |
82 |
| - |
83 |
| - |
84 |
| -## Examples |
85 |
| - The following example defines a class that contains a property and a method that are marked with the <xref:System.ObsoleteAttribute> attribute. Accessing the value of the `OldProperty` property in code generates a compiler warning, but calling the `CallOldMethod` method generates a compiler error. The example also shows the output that results when you attempt to compile the source code. |
86 |
| - |
| 80 | +> Directly applying the [Windows.Foundation.Metadata.DeprecatedAttribute](/uwp/api/Windows.Foundation.Metadata.DeprecatedAttribute) attribute to managed code is not recommended, because this export occurs automatically. |
| 81 | +
|
| 82 | +## Examples |
| 83 | + The following example defines a class that contains a property and a method that are marked with the <xref:System.ObsoleteAttribute> attribute. Accessing the value of the `OldProperty` property in code generates a compiler warning, but calling the `CallOldMethod` method generates a compiler error. The example also shows the output that results when you attempt to compile the source code. |
| 84 | +
|
87 | 85 | [!code-csharp[ObsoleteAttribute#1](~/samples/snippets/csharp/VS_Snippets_CLR/ObsoleteAttribute/CS/obsoleteattributeex1.cs#1)]
|
88 |
| - [!code-vb[ObsoleteAttribute#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/ObsoleteAttribute/vb/obsoleteattributeex1.vb#1)] |
89 |
| - |
| 86 | + [!code-vb[ObsoleteAttribute#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/ObsoleteAttribute/vb/obsoleteattributeex1.vb#1)] |
| 87 | +
|
90 | 88 | ]]></format>
|
91 | 89 | </remarks>
|
92 | 90 | <altmember cref="T:System.Attribute" />
|
93 |
| - <related type="Article" href="/dotnet/standard/attributes/">Extending Metadata Using Attributes</related> |
| 91 | + <related type="Article" href="/dotnet/standard/attributes/">Extend metadata using attributes</related> |
94 | 92 | </Docs>
|
95 | 93 | <Members>
|
96 | 94 | <MemberGroup MemberName=".ctor">
|
|
140 | 138 | <Docs>
|
141 | 139 | <summary>Initializes a new instance of the <see cref="T:System.ObsoleteAttribute" /> class with default properties.</summary>
|
142 | 140 | <remarks>
|
143 |
| - <format type="text/markdown"><![CDATA[ |
144 |
| - |
145 |
| -## Remarks |
146 |
| - The following table shows the initial property values for an instance of <xref:System.ObsoleteAttribute>. |
147 |
| - |
148 |
| -|Property|Value| |
149 |
| -|--------------|-----------| |
150 |
| -|<xref:System.ObsoleteAttribute.IsError%2A>|`false`| |
151 |
| -|<xref:System.ObsoleteAttribute.Message%2A>|`null`| |
152 |
| - |
| 141 | + <format type="text/markdown"><![CDATA[ |
| 142 | +
|
| 143 | +## Remarks |
| 144 | + The following table shows the initial property values for an instance of <xref:System.ObsoleteAttribute>. |
| 145 | +
|
| 146 | +|Property|Value| |
| 147 | +|--------------|-----------| |
| 148 | +|<xref:System.ObsoleteAttribute.IsError%2A>|`false`| |
| 149 | +|<xref:System.ObsoleteAttribute.Message%2A>|`null`| |
| 150 | +|<xref:System.ObsoleteAttribute.DiagnosticId>|`null`| |
| 151 | +|<xref:System.ObsoleteAttribute.UrlFormat>|`null`| |
| 152 | +
|
153 | 153 | ]]></format>
|
154 | 154 | </remarks>
|
155 | 155 | </Docs>
|
|
192 | 192 | <param name="message">The text string that describes alternative workarounds.</param>
|
193 | 193 | <summary>Initializes a new instance of the <see cref="T:System.ObsoleteAttribute" /> class with a specified workaround message.</summary>
|
194 | 194 | <remarks>
|
195 |
| - <format type="text/markdown"><![CDATA[ |
196 |
| - |
197 |
| -## Remarks |
198 |
| - The following table shows the initial property values for an instance of <xref:System.ObsoleteAttribute>. |
199 |
| - |
200 |
| -|Property|Value| |
201 |
| -|--------------|-----------| |
202 |
| -|<xref:System.ObsoleteAttribute.IsError%2A>|`false`.| |
203 |
| -|<xref:System.ObsoleteAttribute.Message%2A>|The workaround message.| |
204 |
| - |
| 195 | + <format type="text/markdown"><![CDATA[ |
| 196 | +
|
| 197 | +## Remarks |
| 198 | + The following table shows the initial property values for an instance of <xref:System.ObsoleteAttribute>. |
| 199 | +
|
| 200 | +|Property|Value| |
| 201 | +|--------------|-----------| |
| 202 | +|<xref:System.ObsoleteAttribute.IsError%2A>|`false`.| |
| 203 | +|<xref:System.ObsoleteAttribute.Message%2A>|The workaround message.| |
| 204 | +|<xref:System.ObsoleteAttribute.DiagnosticId>|`null`.| |
| 205 | +|<xref:System.ObsoleteAttribute.UrlFormat>|`null`.| |
| 206 | +
|
205 | 207 | ]]></format>
|
206 | 208 | </remarks>
|
207 | 209 | </Docs>
|
|
247 | 249 | <see langword="true" /> if the obsolete element usage generates a compiler error; <see langword="false" /> if it generates a compiler warning.</param>
|
248 | 250 | <summary>Initializes a new instance of the <see cref="T:System.ObsoleteAttribute" /> class with a workaround message and a Boolean value indicating whether the obsolete element usage is considered an error.</summary>
|
249 | 251 | <remarks>
|
250 |
| - <format type="text/markdown"><![CDATA[ |
251 |
| - |
252 |
| -## Remarks |
253 |
| - The following table shows the initial property values for an instance of <xref:System.ObsoleteAttribute>. |
254 |
| - |
255 |
| -|Property|Value| |
256 |
| -|--------------|-----------| |
257 |
| -|<xref:System.ObsoleteAttribute.IsError%2A>|The `error` value.| |
258 |
| -|<xref:System.ObsoleteAttribute.Message%2A>|The `message` value.| |
259 |
| - |
| 252 | + <format type="text/markdown"><![CDATA[ |
| 253 | +
|
| 254 | +## Remarks |
| 255 | + The following table shows the initial property values for an instance of <xref:System.ObsoleteAttribute>. |
| 256 | +
|
| 257 | +|Property|Value| |
| 258 | +|--------------|-----------| |
| 259 | +|<xref:System.ObsoleteAttribute.IsError%2A>|The `error` value.| |
| 260 | +|<xref:System.ObsoleteAttribute.Message%2A>|The `message` value.| |
| 261 | +|<xref:System.ObsoleteAttribute.DiagnosticId>|`null`.| |
| 262 | +|<xref:System.ObsoleteAttribute.UrlFormat>|`null`.| |
| 263 | +
|
260 | 264 | ]]></format>
|
261 | 265 | </remarks>
|
262 | 266 | </Docs>
|
|
283 | 287 | <ReturnType>System.String</ReturnType>
|
284 | 288 | </ReturnValue>
|
285 | 289 | <Docs>
|
286 |
| - <summary>Gets or sets the ID the compiler will use when reporting a use of the API.</summary> |
| 290 | + <summary>Gets or sets the ID that the compiler will use when reporting a use of the API.</summary> |
287 | 291 | <value>The unique diagnostic ID.</value>
|
288 |
| - <remarks>To be added.</remarks> |
| 292 | + <remarks> |
| 293 | + <format type="text/markdown"><![CDATA[ |
| 294 | +
|
| 295 | +## Remarks |
| 296 | +
|
| 297 | +The diagnostic ID is shown in build output for warnings and errors. |
| 298 | +
|
| 299 | +This property represents the unique ID that can be used to suppress the warnings or errors, if needed. |
| 300 | +
|
| 301 | + ]]></format> |
| 302 | + </remarks> |
289 | 303 | </Docs>
|
290 | 304 | </Member>
|
291 | 305 | <Member MemberName="IsError">
|
|
323 | 337 | <ReturnType>System.Boolean</ReturnType>
|
324 | 338 | </ReturnValue>
|
325 | 339 | <Docs>
|
326 |
| - <summary>Gets a Boolean value indicating whether the compiler will treat usage of the obsolete program element as an error.</summary> |
| 340 | + <summary>Gets a value that indicates whether the compiler will treat usage of the obsolete program element as an error.</summary> |
327 | 341 | <value>
|
328 | 342 | <see langword="true" /> if the obsolete element usage is considered an error; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
|
329 | 343 | <remarks>
|
330 |
| - <format type="text/markdown"><]
|
336 |
| - [!code-vb[System.ObsoleteAttribute.Message#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.obsoleteattribute.message/vb/obsoleteattribute_message.vb#1)] |
337 |
| - |
| 350 | + [!code-vb[System.ObsoleteAttribute.Message#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.obsoleteattribute.message/vb/obsoleteattribute_message.vb#1)] |
| 351 | +
|
338 | 352 | ]]></format>
|
339 | 353 | </remarks>
|
340 | 354 | </Docs>
|
|
374 | 388 | <ReturnType>System.String</ReturnType>
|
375 | 389 | </ReturnValue>
|
376 | 390 | <Docs>
|
377 |
| - <summary>Gets the workaround message, including a description of the alternative program elements.</summary> |
| 391 | + <summary>Gets the workaround message.</summary> |
378 | 392 | <value>The workaround text string.</value>
|
379 | 393 | <remarks>
|
380 |
| - <format type="text/markdown"><]
|
386 |
| - [!code-vb[System.ObsoleteAttribute.Message#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.obsoleteattribute.message/vb/obsoleteattribute_message.vb#1)] |
387 |
| - |
| 400 | + [!code-vb[System.ObsoleteAttribute.Message#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.obsoleteattribute.message/vb/obsoleteattribute_message.vb#1)] |
| 401 | +
|
388 | 402 | ]]></format>
|
389 | 403 | </remarks>
|
390 | 404 | </Docs>
|
|
413 | 427 | <Docs>
|
414 | 428 | <summary>Gets or sets the URL for corresponding documentation. The API accepts a format string instead of an actual URL, creating a generic URL that includes the diagnostic ID.</summary>
|
415 | 429 | <value>The format string that represents a URL to corresponding documentation.</value>
|
416 |
| - <remarks>To be added.</remarks> |
| 430 | + <remarks> |
| 431 | + <format type="text/markdown"><![CDATA[ |
| 432 | +
|
| 433 | +## Remarks |
| 434 | +
|
| 435 | +An example format string is `https://contoso.com/obsoletion-warnings/{0}`. |
| 436 | +
|
| 437 | + ]]></format> |
| 438 | + </remarks> |
417 | 439 | </Docs>
|
418 | 440 | </Member>
|
419 | 441 | </Members>
|
|
0 commit comments