Mac Guides | Samples

MonoMac.Foundation.PreserveAttribute Class

Prevents the MonoMac linker from linking the target.

See Also: PreserveAttribute


[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Delegate | System.AttributeTargets.All)]
public sealed class PreserveAttribute : Attribute


This attribute is used at link time by the MonoMac linker to skip certain classes, structures, enumerations or other objects from being linked.

By applying this attribute all of the members of the target will be kept as if they had been referenced by the code.

This attribute is useful for example when using classes that use reflection (for example web services) and that use this information for serialization and deserialization.


Namespace: MonoMac.Foundation
Assembly: XamMac (in XamMac.dll)
Assembly Versions:

The members of MonoMac.Foundation.PreserveAttribute are listed below.

See Also: Attribute

Public Constructors

Public Fields

AllMembersBoolean. Ensures that all members of this type are preserved.
ConditionalBoolean. Flags the method as a method to preserve during linking if the container class is pulled in.