-
Notifications
You must be signed in to change notification settings - Fork 42
/
PreserveAttribute.xml
164 lines (160 loc) · 7.49 KB
/
PreserveAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<Type Name="PreserveAttribute" FullName="Foundation.PreserveAttribute">
<TypeSignature Language="C#" Value="public sealed class PreserveAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit PreserveAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:Foundation.PreserveAttribute" />
<TypeSignature Language="F#" Value="type PreserveAttribute = class
 inherit Attribute" />
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>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, AllowMultiple=true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Prevents the MonoTouch linker from linking the target.</summary>
<remarks>
<para>
This attribute is used at link time by the MonoTouch linker to skip certain classes, structures, enumerations or other objects from being linked.
</para>
<para>
By applying this attribute all of the members of the target will be kept as if they had been referenced by the code.
</para>
<para>
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. </para>
<para>
Starting with MonoTouch 6.0.9 this attribute can also be used
at the assembly level, effectively duplicating the same
behaviour as <c>--linkskip=ASSEMBLY</c> but without the need
to duplicate the extra argument to every project.
</para>
<para>
You do not actually need to take a dependency on the Xamarin
assemblies, for example, if you are a third-party developer
that is creating a component or nuget package that is safe to
be linked, you can just include the LinkerSafe attribute
source code in your application, and the Xamarin linker will
recognize it.
</para>
<para>
To use in an assembly, without taking a dependency in Xamarin's assemblies:
</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
[System.AttributeUsage(System.AttributeTargets.All)]
class PreserveAttribute : System.Attribute {
public PreserveAttribute () {}
public bool Conditional { get; set; }
}
[assembly:Preserve]
]]></code>
</example>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public PreserveAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Foundation.PreserveAttribute.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Instruct the MonoTouch linker to preserve the decorated code</summary>
<remarks>By default the linker, when enabled, will remove all the code that is not directly used by the application.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public PreserveAttribute (Type type);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type type) cil managed" />
<MemberSignature Language="DocId" Value="M:Foundation.PreserveAttribute.#ctor(System.Type)" />
<MemberSignature Language="F#" Value="new Foundation.PreserveAttribute : Type -> Foundation.PreserveAttribute" Usage="new Foundation.PreserveAttribute type" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="type" Type="System.Type" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AllMembers">
<MemberSignature Language="C#" Value="public bool AllMembers;" />
<MemberSignature Language="ILAsm" Value=".field public bool AllMembers" />
<MemberSignature Language="DocId" Value="F:Foundation.PreserveAttribute.AllMembers" />
<MemberSignature Language="F#" Value="val mutable AllMembers : bool" Usage="Foundation.PreserveAttribute.AllMembers" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Ensures that all members of this type are preserved.</summary>
<remarks>All members of this type, including fields, properties, methods, subclasses are preserved during linking.</remarks>
</Docs>
</Member>
<Member MemberName="Conditional">
<MemberSignature Language="C#" Value="public bool Conditional;" />
<MemberSignature Language="ILAsm" Value=".field public bool Conditional" />
<MemberSignature Language="DocId" Value="F:Foundation.PreserveAttribute.Conditional" />
<MemberSignature Language="F#" Value="val mutable Conditional : bool" Usage="Foundation.PreserveAttribute.Conditional" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Flags the method as a method to preserve during linking if the container class is pulled in.</summary>
<remarks>
<para>
If the Conditional value is set on a Preserve attribute on a method, then the method will be preserved if the containing NSObject is kept after the linker has done its job.
</para>
<para>
You would typically use this for callbacks that you know will be called in your code dynamically (for example with a selector invocation from Objective-C) since a static linker would not be able to infer that this particual method is required.
</para>
</remarks>
</Docs>
</Member>
</Members>
</Type>