Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / class / corlib / Documentation / en / System.Reflection / CustomAttributeData.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="CustomAttributeData" FullName="System.Reflection.CustomAttributeData">
3   <TypeSignature Language="C#" Value="public class CustomAttributeData" />
4   <TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit CustomAttributeData extends System.Object" />
5   <AssemblyInfo>
6     <AssemblyName>mscorlib</AssemblyName>
7     <AssemblyVersion>2.0.0.0</AssemblyVersion>
8     <AssemblyVersion>4.0.0.0</AssemblyVersion>
9   </AssemblyInfo>
10   <Base>
11     <BaseTypeName>System.Object</BaseTypeName>
12   </Base>
13   <Interfaces />
14   <Attributes>
15     <Attribute>
16       <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
17     </Attribute>
18   </Attributes>
19   <Docs>
20     <since version=".NET 2.0" />
21     <remarks>
22       <attribution license="cc4" from="Microsoft" modified="false" />
23       <para>Code that is being examined in the reflection-only context cannot be executed, so it is not always possible to examine custom attributes by creating instances of them and then examining their properties, using methods like <see cref="Overload:System.Attribute.GetCustomAttributes" />, <see cref="Overload:System.Reflection.MemberInfo.GetCustomAttributes" />, and so on. If the code for the attribute type itself is loaded into the reflection-only context, it cannot be executed. </para>
24       <para>The <see cref="T:System.Reflection.CustomAttributeData" /> class allows examination of custom attributes in the reflection-only context by providing an abstraction for attributes. The members of this class can be used to obtain the positional arguments and named arguments of the attribute. Use the <see cref="P:System.Reflection.CustomAttributeData.ConstructorArguments" /> property to get a list of <see cref="T:System.Reflection.CustomAttributeTypedArgument" /> structures that represent the positional arguments, and use the <see cref="P:System.Reflection.CustomAttributeData.NamedArguments" /> property to get a list of <see cref="T:System.Reflection.CustomAttributeNamedArgument" /> structures that represent the named arguments. </para>
25       <block subset="none" type="note">
26         <para>The <see cref="T:System.Reflection.CustomAttributeNamedArgument" /> structure only provides information about the attribute property used to get and set the argument value. To obtain the type and value of the argument, use the <see cref="P:System.Reflection.CustomAttributeNamedArgument.TypedValue" /> property to obtain a <see cref="T:System.Reflection.CustomAttributeTypedArgument" /> structure.</para>
27       </block>
28       <para>When you have a <see cref="T:System.Reflection.CustomAttributeTypedArgument" /> structure for an argument, whether named or positional, use the <see cref="P:System.Reflection.CustomAttributeTypedArgument.ArgumentType" /> property to get the type and the <see cref="P:System.Reflection.CustomAttributeTypedArgument.Value" /> property to get the value. </para>
29       <block subset="none" type="note">
30         <para>For an array argument, the <see cref="P:System.Reflection.CustomAttributeTypedArgument.Value" /> property returns a generic <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> of <see cref="T:System.Reflection.CustomAttributeTypedArgument" /> objects. Each <see cref="T:System.Reflection.CustomAttributeTypedArgument" /> object in the collection represents the corresponding element of the array. </para>
31       </block>
32       <para>
33         <see cref="T:System.Reflection.CustomAttributeData" /> can be used in the execution context as well as in the reflection-only context. For example, you might want to avoid loading the assembly that contains the code for a custom attribute. Using the <see cref="T:System.Reflection.CustomAttributeData" /> class is different from using methods like <see cref="Overload:System.Attribute.GetCustomAttributes" />:</para>
34       <list type="bullet">
35         <item>
36           <para>The properties and methods of <see cref="T:System.Reflection.CustomAttributeData" /> only provide you with the values that were specified for the attribute instance, not the semantics of the constructor. For example, a string argument of an attribute might be converted internally to some other representation, and returned in a canonical form; or a property might have side effects when the actual attribute code is executed.</para>
37         </item>
38         <item>
39           <para>The properties and methods of <see cref="T:System.Reflection.CustomAttributeData" /> do not allow you to retrieve the custom attributes inherited from base classes. </para>
40         </item>
41       </list>
42       <para>To create instances of the <see cref="T:System.Reflection.CustomAttributeData" /> class, use the static (Shared in Visual Basic) <see cref="Overload:System.Reflection.CustomAttributeData.GetCustomAttributes" /> factory methods.</para>
43     </remarks>
44     <summary>
45       <attribution license="cc4" from="Microsoft" modified="false" />
46       <para>Provides access to custom attribute data for assemblies, modules, types, members and parameters that are loaded into the reflection-only context.</para>
47     </summary>
48   </Docs>
49   <Members>
50     <Member MemberName=".ctor">
51       <MemberSignature Language="C#" Value="protected CustomAttributeData ();" />
52       <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
53       <MemberType>Constructor</MemberType>
54       <AssemblyInfo>
55         <AssemblyVersion>4.0.0.0</AssemblyVersion>
56       </AssemblyInfo>
57       <Parameters />
58       <Docs>
59         <remarks>
60           <attribution license="cc4" from="Microsoft" modified="false" />
61           <para>This constructor is invoked by derived classes during the construction of <see cref="T:System.Reflection.CustomAttributeData" /> objects.</para>
62         </remarks>
63         <summary>
64           <attribution license="cc4" from="Microsoft" modified="false" />
65           <para>Initializes a new instance of the <see cref="T:System.Reflection.CustomAttributeData" /> class.</para>
66         </summary>
67       </Docs>
68     </Member>
69     <Member MemberName="AttributeType">
70       <MemberSignature Language="C#" Value="public Type AttributeType { get; }" />
71       <MemberSignature Language="ILAsm" Value=".property instance class System.Type AttributeType" />
72       <MemberType>Property</MemberType>
73       <AssemblyInfo>
74         <AssemblyVersion>4.0.0.0</AssemblyVersion>
75       </AssemblyInfo>
76       <ReturnValue>
77         <ReturnType>System.Type</ReturnType>
78       </ReturnValue>
79       <Docs>
80         <value>To be added.</value>
81         <remarks>To be added.</remarks>
82         <summary>
83           <attribution license="cc4" from="Microsoft" modified="false" />
84           <para>Gets the type of the attribute.</para>
85         </summary>
86       </Docs>
87     </Member>
88     <Member MemberName="Constructor">
89       <MemberSignature Language="C#" Value="public virtual System.Reflection.ConstructorInfo Constructor { get; }" />
90       <MemberSignature Language="ILAsm" Value=".property instance class System.Reflection.ConstructorInfo Constructor" />
91       <MemberType>Property</MemberType>
92       <AssemblyInfo>
93         <AssemblyVersion>2.0.0.0</AssemblyVersion>
94         <AssemblyVersion>4.0.0.0</AssemblyVersion>
95       </AssemblyInfo>
96       <Attributes>
97         <Attribute>
98           <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
99         </Attribute>
100       </Attributes>
101       <ReturnValue>
102         <ReturnType>System.Reflection.ConstructorInfo</ReturnType>
103       </ReturnValue>
104       <Docs>
105         <value>To be added.</value>
106         <since version=".NET 2.0" />
107         <remarks>
108           <attribution license="cc4" from="Microsoft" modified="false" />
109           <para>If an attribute type has multiple constructors, this property returns only the particular constructor that would have initialized the attribute instance represented by the current <see cref="T:System.Reflection.CustomAttributeData" /> object.</para>
110         </remarks>
111         <summary>
112           <attribution license="cc4" from="Microsoft" modified="false" />
113           <para>Gets a <see cref="T:System.Reflection.ConstructorInfo" /> object that represents the constructor that would have initialized the custom attribute.</para>
114         </summary>
115       </Docs>
116     </Member>
117     <Member MemberName="ConstructorArguments">
118       <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeTypedArgument&gt; ConstructorArguments { get; }" />
119       <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1&lt;valuetype System.Reflection.CustomAttributeTypedArgument&gt; ConstructorArguments" />
120       <MemberType>Property</MemberType>
121       <AssemblyInfo>
122         <AssemblyVersion>2.0.0.0</AssemblyVersion>
123         <AssemblyVersion>4.0.0.0</AssemblyVersion>
124       </AssemblyInfo>
125       <Attributes>
126         <Attribute>
127           <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
128         </Attribute>
129       </Attributes>
130       <ReturnValue>
131         <ReturnType>System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeTypedArgument&gt;</ReturnType>
132       </ReturnValue>
133       <Docs>
134         <value>To be added.</value>
135         <since version=".NET 2.0" />
136         <remarks>
137           <attribution license="cc4" from="Microsoft" modified="false" />
138           <para>This method gets the positional arguments that were specified for the custom attribute instance without executing any of the custom attribute code. Thus, it can be used in the reflection-only context.</para>
139           <para>Use the <see cref="P:System.Reflection.CustomAttributeData.NamedArguments" /> method to get the named arguments specified for the attribute instance.</para>
140         </remarks>
141         <summary>
142           <attribution license="cc4" from="Microsoft" modified="false" />
143           <para>Gets the list of positional arguments specified for the attribute instance represented by the <see cref="T:System.Reflection.CustomAttributeData" /> object.</para>
144         </summary>
145       </Docs>
146     </Member>
147     <Member MemberName="Equals">
148       <MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
149       <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" />
150       <MemberType>Method</MemberType>
151       <AssemblyInfo>
152         <AssemblyVersion>2.0.0.0</AssemblyVersion>
153         <AssemblyVersion>4.0.0.0</AssemblyVersion>
154       </AssemblyInfo>
155       <ReturnValue>
156         <ReturnType>System.Boolean</ReturnType>
157       </ReturnValue>
158       <Parameters>
159         <Parameter Name="obj" Type="System.Object" />
160       </Parameters>
161       <Docs>
162         <remarks>To be added.</remarks>
163         <summary>
164           <attribution license="cc4" from="Microsoft" modified="false" />
165           <para>Returns a value that indicates whether this instance is equal to a specified object.</para>
166         </summary>
167         <returns>
168           <attribution license="cc4" from="Microsoft" modified="false" />
169           <para>true if <paramref name="obj" /> is equal to the current instance; otherwise, false.</para>
170         </returns>
171         <param name="obj">
172           <attribution license="cc4" from="Microsoft" modified="false" />An object to compare with this instance, or null.</param>
173       </Docs>
174     </Member>
175     <Member MemberName="GetCustomAttributes">
176       <MemberSignature Language="C#" Value="public static System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt; GetCustomAttributes (System.Reflection.Assembly target);" />
177       <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IList`1&lt;class System.Reflection.CustomAttributeData&gt; GetCustomAttributes(class System.Reflection.Assembly target) cil managed" />
178       <MemberType>Method</MemberType>
179       <AssemblyInfo>
180         <AssemblyVersion>2.0.0.0</AssemblyVersion>
181         <AssemblyVersion>4.0.0.0</AssemblyVersion>
182       </AssemblyInfo>
183       <ReturnValue>
184         <ReturnType>System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt;</ReturnType>
185       </ReturnValue>
186       <Parameters>
187         <Parameter Name="target" Type="System.Reflection.Assembly" />
188       </Parameters>
189       <Docs>
190         <since version=".NET 2.0" />
191         <remarks>
192           <attribution license="cc4" from="Microsoft" modified="false" />
193           <para>This method provides an alternative to the <see cref="Overload:System.Reflection.Assembly.GetCustomAttributes" /> method that can always be used in the Reflection-only context.</para>
194         </remarks>
195         <summary>
196           <attribution license="cc4" from="Microsoft" modified="false" />
197           <para>Returns a list of <see cref="T:System.Reflection.CustomAttributeData" /> objects representing data about the attributes that have been applied to the target assembly.</para>
198         </summary>
199         <returns>
200           <attribution license="cc4" from="Microsoft" modified="false" />
201           <para>A list of objects that represent data about the attributes that have been applied to the target assembly.</para>
202         </returns>
203         <param name="target">
204           <attribution license="cc4" from="Microsoft" modified="false" />The assembly whose custom attribute data is to be retrieved.</param>
205       </Docs>
206     </Member>
207     <Member MemberName="GetCustomAttributes">
208       <MemberSignature Language="C#" Value="public static System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt; GetCustomAttributes (System.Reflection.MemberInfo target);" />
209       <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IList`1&lt;class System.Reflection.CustomAttributeData&gt; GetCustomAttributes(class System.Reflection.MemberInfo target) cil managed" />
210       <MemberType>Method</MemberType>
211       <AssemblyInfo>
212         <AssemblyVersion>2.0.0.0</AssemblyVersion>
213         <AssemblyVersion>4.0.0.0</AssemblyVersion>
214       </AssemblyInfo>
215       <ReturnValue>
216         <ReturnType>System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt;</ReturnType>
217       </ReturnValue>
218       <Parameters>
219         <Parameter Name="target" Type="System.Reflection.MemberInfo" />
220       </Parameters>
221       <Docs>
222         <since version=".NET 2.0" />
223         <remarks>
224           <attribution license="cc4" from="Microsoft" modified="false" />
225           <para>This method overload gets custom attribute data for types, nested types, and type members, because the <see cref="T:System.Type" /> class and the classes in the <see cref="N:System.Reflection" /> namespace that represent type members all derive from <see cref="T:System.Reflection.MemberInfo" />. </para>
226         </remarks>
227         <summary>
228           <attribution license="cc4" from="Microsoft" modified="false" />
229           <para>Returns a list of <see cref="T:System.Reflection.CustomAttributeData" /> objects representing data about the attributes that have been applied to the target member.</para>
230         </summary>
231         <returns>
232           <attribution license="cc4" from="Microsoft" modified="false" />
233           <para>A list of objects that represent data about the attributes that have been applied to the target member.</para>
234         </returns>
235         <param name="target">
236           <attribution license="cc4" from="Microsoft" modified="false" />The member whose attribute data is to be retrieved.</param>
237       </Docs>
238     </Member>
239     <Member MemberName="GetCustomAttributes">
240       <MemberSignature Language="C#" Value="public static System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt; GetCustomAttributes (System.Reflection.Module target);" />
241       <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IList`1&lt;class System.Reflection.CustomAttributeData&gt; GetCustomAttributes(class System.Reflection.Module target) cil managed" />
242       <MemberType>Method</MemberType>
243       <AssemblyInfo>
244         <AssemblyVersion>2.0.0.0</AssemblyVersion>
245         <AssemblyVersion>4.0.0.0</AssemblyVersion>
246       </AssemblyInfo>
247       <ReturnValue>
248         <ReturnType>System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt;</ReturnType>
249       </ReturnValue>
250       <Parameters>
251         <Parameter Name="target" Type="System.Reflection.Module" />
252       </Parameters>
253       <Docs>
254         <remarks>To be added.</remarks>
255         <since version=".NET 2.0" />
256         <summary>
257           <attribution license="cc4" from="Microsoft" modified="false" />
258           <para>Returns a list of <see cref="T:System.Reflection.CustomAttributeData" /> objects representing data about the attributes that have been applied to the target module.</para>
259         </summary>
260         <returns>
261           <attribution license="cc4" from="Microsoft" modified="false" />
262           <para>A list of objects that represent data about the attributes that have been applied to the target module.</para>
263         </returns>
264         <param name="target">
265           <attribution license="cc4" from="Microsoft" modified="false" />The module whose custom attribute data is to be retrieved.</param>
266       </Docs>
267     </Member>
268     <Member MemberName="GetCustomAttributes">
269       <MemberSignature Language="C#" Value="public static System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt; GetCustomAttributes (System.Reflection.ParameterInfo target);" />
270       <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IList`1&lt;class System.Reflection.CustomAttributeData&gt; GetCustomAttributes(class System.Reflection.ParameterInfo target) cil managed" />
271       <MemberType>Method</MemberType>
272       <AssemblyInfo>
273         <AssemblyVersion>2.0.0.0</AssemblyVersion>
274         <AssemblyVersion>4.0.0.0</AssemblyVersion>
275       </AssemblyInfo>
276       <ReturnValue>
277         <ReturnType>System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeData&gt;</ReturnType>
278       </ReturnValue>
279       <Parameters>
280         <Parameter Name="target" Type="System.Reflection.ParameterInfo" />
281       </Parameters>
282       <Docs>
283         <since version=".NET 2.0" />
284         <remarks>
285           <attribution license="cc4" from="Microsoft" modified="false" />
286           <para>This method provides an alternative to the <see cref="Overload:System.Reflection.ParameterInfo.GetCustomAttributes" /> method that can always be used in the Reflection-only context.</para>
287         </remarks>
288         <summary>
289           <attribution license="cc4" from="Microsoft" modified="false" />
290           <para>Returns a list of <see cref="T:System.Reflection.CustomAttributeData" /> objects representing data about the attributes that have been applied to the target parameter.</para>
291         </summary>
292         <returns>
293           <attribution license="cc4" from="Microsoft" modified="false" />
294           <para>A list of objects that represent data about the attributes that have been applied to the target parameter.</para>
295         </returns>
296         <param name="target">
297           <attribution license="cc4" from="Microsoft" modified="false" />The parameter whose attribute data is to be retrieved.</param>
298       </Docs>
299     </Member>
300     <Member MemberName="GetHashCode">
301       <MemberSignature Language="C#" Value="public override int GetHashCode ();" />
302       <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
303       <MemberType>Method</MemberType>
304       <AssemblyInfo>
305         <AssemblyVersion>2.0.0.0</AssemblyVersion>
306         <AssemblyVersion>4.0.0.0</AssemblyVersion>
307       </AssemblyInfo>
308       <ReturnValue>
309         <ReturnType>System.Int32</ReturnType>
310       </ReturnValue>
311       <Parameters />
312       <Docs>
313         <summary>To be added.</summary>
314         <returns>To be added.</returns>
315         <remarks>To be added.</remarks>
316       </Docs>
317     </Member>
318     <Member MemberName="NamedArguments">
319       <MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeNamedArgument&gt; NamedArguments { get; }" />
320       <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1&lt;valuetype System.Reflection.CustomAttributeNamedArgument&gt; NamedArguments" />
321       <MemberType>Property</MemberType>
322       <AssemblyInfo>
323         <AssemblyVersion>2.0.0.0</AssemblyVersion>
324         <AssemblyVersion>4.0.0.0</AssemblyVersion>
325       </AssemblyInfo>
326       <ReturnValue>
327         <ReturnType>System.Collections.Generic.IList&lt;System.Reflection.CustomAttributeNamedArgument&gt;</ReturnType>
328       </ReturnValue>
329       <Docs>
330         <value>To be added.</value>
331         <since version=".NET 2.0" />
332         <remarks>
333           <attribution license="cc4" from="Microsoft" modified="false" />
334           <para>This method gets the named arguments that were specified for the custom attribute instance without executing any of the custom attribute code. Thus, it can be used in the Reflection-only context. </para>
335           <para>The list that is returned contains only the named arguments that were specified for the attribute instance.</para>
336           <para>Use the <see cref="P:System.Reflection.CustomAttributeData.ConstructorArguments" /> method to get the positional arguments that were specified for the attribute instance. </para>
337         </remarks>
338         <summary>
339           <attribution license="cc4" from="Microsoft" modified="false" />
340           <para>Gets the list of named arguments specified for the attribute instance represented by the <see cref="T:System.Reflection.CustomAttributeData" /> object.</para>
341         </summary>
342       </Docs>
343     </Member>
344     <Member MemberName="ToString">
345       <MemberSignature Language="C#" Value="public override string ToString ();" />
346       <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
347       <MemberType>Method</MemberType>
348       <AssemblyInfo>
349         <AssemblyVersion>2.0.0.0</AssemblyVersion>
350         <AssemblyVersion>4.0.0.0</AssemblyVersion>
351       </AssemblyInfo>
352       <ReturnValue>
353         <ReturnType>System.String</ReturnType>
354       </ReturnValue>
355       <Parameters />
356       <Docs>
357         <since version=".NET 2.0" />
358         <remarks>
359           <attribution license="cc4" from="Microsoft" modified="false" />
360           <para>The string value includes the attribute type, the attribute parameters, and the named parameters.</para>
361         </remarks>
362         <summary>
363           <attribution license="cc4" from="Microsoft" modified="false" />
364           <para>Returns a string representation of the custom attribute.</para>
365         </summary>
366         <returns>
367           <attribution license="cc4" from="Microsoft" modified="false" />
368           <para>A string value that represents the custom attribute.</para>
369         </returns>
370       </Docs>
371     </Member>
372   </Members>
373 </Type>