Język

PreserveAttribute Class

Definition

Caution

Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]

Identifies code that older Android linkers should preserve. This attribute is obsolete; annotated members may still be trimmed. Use DynamicDependencyAttribute instead.

[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
Inheritance
PreserveAttribute
Attributes

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Name Description
PreserveAttribute()

Initializes a new instance of this obsolete attribute.

Fields

Name Description
AllMembers

When set to true on a type, earlier Android linkers used this field to preserve the type's fields and methods. This obsolete attribute no longer guarantees preservation.

Conditional

When set to true on a method, earlier Android linkers preserved the method when its declaring type was preserved, without forcing the declaring type to be preserved. This obsolete attribute no longer guarantees preservation.

Applies to