Language

PreserveAttribute クラス

定義

注意事項

Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]

古い Android リンカーが保持する必要があるコードを識別します。 この属性は古い形式です。注釈付きメンバーは引き続きトリミングできます。 DynamicDependencyAttribute を代わりに使用します。

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct)]
[System.Obsolete("Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]")]
public sealed class PreserveAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct)>]
[<System.Obsolete("Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]")>]
type PreserveAttribute = class
    inherit Attribute
継承
PreserveAttribute
属性

コンストラクター

Name 説明
PreserveAttribute()
古い.

この古い属性の新しいインスタンスを初期化します。

フィールド

Name 説明
AllMembers
古い.

型に true に設定すると、以前の Android リンカーはこのフィールドを使用して型のフィールドとメソッドを保持しました。 この古い属性では、保持が保証されなくなりました。

Conditional
古い.

メソッドに対して true に設定すると、以前の Android リンカーは、宣言する型を強制的に保持することなく、その宣言型が保持されたときにメソッドを保持していました。 この古い属性では、保持が保証されなくなりました。

適用対象