语言

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
特性

构造函数

名称 说明
PreserveAttribute()
已过时.

初始化此过时属性的新实例。

字段

名称 说明
AllMembers
已过时.

当设置为 true 某个类型时,早期 Android 链接器使用此字段来保留该类型的字段和方法。 此过时属性不再保证保留。

Conditional
已过时.

在方法上设置为 true 此方法时,早期 Android 链接器在保留其声明类型时保留该方法,而无需强制保留声明类型。 此过时属性不再保证保留。

适用于