DeprecatedAttribute 類別

定義

表示類型或成員應該在元數據中標示為已被取代。 編譯程式和其他開發人員工具可以讀取這個屬性,並提供使用者有關取代類型和可能替代專案的資訊。

public ref class DeprecatedAttribute sealed : Attribute
/// [Windows.Foundation.Metadata.AllowMultiple]
/// [Windows.Foundation.Metadata.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.RuntimeClass | System.AttributeTargets.Struct)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.FoundationContract, 65536)]
class DeprecatedAttribute final : Attribute
[Windows.Foundation.Metadata.AllowMultiple]
[Windows.Foundation.Metadata.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.RuntimeClass | System.AttributeTargets.Struct)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)]
public sealed class DeprecatedAttribute : Attribute
Public NotInheritable Class DeprecatedAttribute
Inherits Attribute
繼承
DeprecatedAttribute
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.FoundationContract (已於 v1.0 引進)

建構函式

DeprecatedAttribute(String, DeprecationType, UInt32)

建立並初始化 屬性的新實例。

DeprecatedAttribute(String, DeprecationType, UInt32, Platform)

建立並初始化 屬性的新實例,包括目標 平臺 值。

DeprecatedAttribute(String, DeprecationType, UInt32, String)

建立並初始化 屬性的新實例。

DeprecatedAttribute(String, DeprecationType, UInt32, Type)

建立並初始化 屬性的新實例。

適用於