Merge pull request #926 from ermshiperete/novell-bug-674098
[mono.git] / mcs / class / System.ComponentModel.Composition / Documentation / en / System.ComponentModel.Composition / ImportAttribute.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="ImportAttribute" FullName="System.ComponentModel.Composition.ImportAttribute">
3   <TypeSignature Language="C#" Value="public class ImportAttribute : Attribute, System.ComponentModel.Composition.IAttributedImport" />
4   <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ImportAttribute extends System.Attribute implements class System.ComponentModel.Composition.IAttributedImport" />
5   <AssemblyInfo>
6     <AssemblyName>System.ComponentModel.Composition</AssemblyName>
7     <AssemblyVersion>4.0.0.0</AssemblyVersion>
8   </AssemblyInfo>
9   <Base>
10     <BaseTypeName>System.Attribute</BaseTypeName>
11   </Base>
12   <Interfaces>
13     <Interface>
14       <InterfaceName>System.ComponentModel.Composition.IAttributedImport</InterfaceName>
15     </Interface>
16   </Interfaces>
17   <Attributes>
18     <Attribute>
19       <AttributeName>System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)</AttributeName>
20     </Attribute>
21   </Attributes>
22   <Docs>
23     <remarks>
24       <attribution license="cc4" from="Microsoft" modified="false" />
25       <para>In the Attributed Programming Model, the <see cref="T:System.ComponentModel.Composition.ImportAttribute" /> is used to declare the imports, or dependencies, of a given part. It can decorate a property, a field, or a method. During composition, a part's imports will be filled by the <see cref="T:System.ComponentModel.Composition.Hosting.CompositionContainer" /> object to which that part belongs, by using the exports provided to that <see cref="T:System.ComponentModel.Composition.Hosting.CompositionContainer" /> object.</para>
26       <para>Whether an import matches a given export is determined primarily by comparing the contract name and the contract type. Ordinarily, you do not have to specify either of these when using the import attribute in code, and they will be automatically inferred from the type of the decorated member. If the import must match an export of a different type (for example, a subclass of the type of the decorated member, or an interface implemented by that member), then the contract type must be explicitly specified. The contract name can also be explicitly specified, for example to distinguish between multiple contracts with the same type, but it is usually better to do this through metadata. For more information about metadata, see <see cref="T:System.ComponentModel.Composition.PartMetadataAttribute" />.</para>
27     </remarks>
28     <summary>
29       <attribution license="cc4" from="Microsoft" modified="false" />
30       <para>Specifies that a property, field, or parameter value should be provided by the <see cref="T:System.ComponentModel.Composition.Hosting.CompositionContainer" />.object</para>
31     </summary>
32   </Docs>
33   <Members>
34     <Member MemberName=".ctor">
35       <MemberSignature Language="C#" Value="public ImportAttribute ();" />
36       <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
37       <MemberType>Constructor</MemberType>
38       <AssemblyInfo>
39         <AssemblyVersion>4.0.0.0</AssemblyVersion>
40       </AssemblyInfo>
41       <Parameters />
42       <Docs>
43         <remarks>
44           <attribution license="cc4" from="Microsoft" modified="false" />
45           <para>The default contract name is the result of calling the <see cref="M:System.ComponentModel.Composition.AttributedModelServices.GetContractName(System.Type)" /> method on the property, field, or parameter type that this is marked with this attribute.</para>
46           <para>The contract name is compared by using the <see cref="P:System.StringComparer.Ordinal" /> property to perform a case-sensitive, non-linguistic comparison.</para>
47         </remarks>
48         <summary>
49           <attribution license="cc4" from="Microsoft" modified="false" />
50           <para>Initializes a new instance of the <see cref="T:System.ComponentModel.Composition.ImportAttribute" /> class, importing the export with the default contract name.</para>
51         </summary>
52       </Docs>
53     </Member>
54     <Member MemberName=".ctor">
55       <MemberSignature Language="C#" Value="public ImportAttribute (string contractName);" />
56       <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string contractName) cil managed" />
57       <MemberType>Constructor</MemberType>
58       <AssemblyInfo>
59         <AssemblyVersion>4.0.0.0</AssemblyVersion>
60       </AssemblyInfo>
61       <Parameters>
62         <Parameter Name="contractName" Type="System.String" />
63       </Parameters>
64       <Docs>
65         <remarks>
66           <attribution license="cc4" from="Microsoft" modified="false" />
67           <para>The default contract name is the result of calling the <see cref="M:System.ComponentModel.Composition.AttributedModelServices.GetContractName(System.Type)" /> method on the property, field, or parameter type that is marked with this attribute.</para>
68           <para>The contract name is compared by using the <see cref="P:System.StringComparer.Ordinal" /> property to perform a case-sensitive, non-linguistic comparison.</para>
69         </remarks>
70         <summary>
71           <attribution license="cc4" from="Microsoft" modified="false" />
72           <para>Initializes a new instance of the <see cref="T:System.ComponentModel.Composition.ImportAttribute" /> class, importing the export with the specified contract name.</para>
73         </summary>
74         <param name="contractName">
75           <attribution license="cc4" from="Microsoft" modified="false" />The contract name of the export to import, or null or an empty string ("") to use the default contract name.</param>
76       </Docs>
77     </Member>
78     <Member MemberName=".ctor">
79       <MemberSignature Language="C#" Value="public ImportAttribute (Type contractType);" />
80       <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type contractType) cil managed" />
81       <MemberType>Constructor</MemberType>
82       <AssemblyInfo>
83         <AssemblyVersion>4.0.0.0</AssemblyVersion>
84       </AssemblyInfo>
85       <Parameters>
86         <Parameter Name="contractType" Type="System.Type" />
87       </Parameters>
88       <Docs>
89         <remarks>
90           <attribution license="cc4" from="Microsoft" modified="false" />
91           <para>The contract name is the result of calling the <see cref="M:System.ComponentModel.Composition.AttributedModelServices.GetContractName(System.Type)" /> method on <paramref name="contractType" />.</para>
92           <para>The default contract name is the result of calling the <see cref="M:System.ComponentModel.Composition.AttributedModelServices.GetContractName(System.Type)" /> method on the property, field, or parameter type that is marked with this attribute.</para>
93           <para>The contract name is compared by using the <see cref="P:System.StringComparer.Ordinal" /> property to perform a case-sensitive, non-linguistic comparison.</para>
94         </remarks>
95         <summary>
96           <attribution license="cc4" from="Microsoft" modified="false" />
97           <para>Initializes a new instance of the <see cref="T:System.ComponentModel.Composition.ImportAttribute" /> class, importing the export with the contract name derived from the specified type.</para>
98         </summary>
99         <param name="contractType">
100           <attribution license="cc4" from="Microsoft" modified="false" />The type to derive the contract name of the export from, or null to use the default contract name.</param>
101       </Docs>
102     </Member>
103     <Member MemberName=".ctor">
104       <MemberSignature Language="C#" Value="public ImportAttribute (string contractName, Type contractType);" />
105       <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string contractName, class System.Type contractType) cil managed" />
106       <MemberType>Constructor</MemberType>
107       <AssemblyInfo>
108         <AssemblyVersion>4.0.0.0</AssemblyVersion>
109       </AssemblyInfo>
110       <Parameters>
111         <Parameter Name="contractName" Type="System.String" />
112         <Parameter Name="contractType" Type="System.Type" />
113       </Parameters>
114       <Docs>
115         <remarks>To be added.</remarks>
116         <summary>
117           <attribution license="cc4" from="Microsoft" modified="false" />
118           <para>Initializes a new instance of the <see cref="T:System.ComponentModel.Composition.ImportAttribute" /> class, importing the export with the specified contract name and type.</para>
119         </summary>
120         <param name="contractName">
121           <attribution license="cc4" from="Microsoft" modified="false" />The contract name of the export to import, or null or an empty string ("") to use the default contract name.</param>
122         <param name="contractType">
123           <attribution license="cc4" from="Microsoft" modified="false" />The type of the export to import.</param>
124       </Docs>
125     </Member>
126     <Member MemberName="AllowDefault">
127       <MemberSignature Language="C#" Value="public bool AllowDefault { get; set; }" />
128       <MemberSignature Language="ILAsm" Value=".property instance bool AllowDefault" />
129       <MemberType>Property</MemberType>
130       <AssemblyInfo>
131         <AssemblyVersion>4.0.0.0</AssemblyVersion>
132       </AssemblyInfo>
133       <ReturnValue>
134         <ReturnType>System.Boolean</ReturnType>
135       </ReturnValue>
136       <Docs>
137         <value>To be added.</value>
138         <remarks>
139           <attribution license="cc4" from="Microsoft" modified="false" />
140           <para>The default value of the type of a property, field, or parameter is null for reference types and zero for numeric value types. For other value types, the default value will be each field of the value type initialized to zero if the field is a value type, or null if the field is a reference type.</para>
141         </remarks>
142         <summary>
143           <attribution license="cc4" from="Microsoft" modified="false" />
144           <para>Gets or sets a value that indicates whether the property, field, or parameter will be set to its type's default value when an export with the contract name is not present in the container.</para>
145         </summary>
146       </Docs>
147     </Member>
148     <Member MemberName="AllowRecomposition">
149       <MemberSignature Language="C#" Value="public bool AllowRecomposition { get; set; }" />
150       <MemberSignature Language="ILAsm" Value=".property instance bool AllowRecomposition" />
151       <MemberType>Property</MemberType>
152       <AssemblyInfo>
153         <AssemblyVersion>4.0.0.0</AssemblyVersion>
154       </AssemblyInfo>
155       <ReturnValue>
156         <ReturnType>System.Boolean</ReturnType>
157       </ReturnValue>
158       <Docs>
159         <value>To be added.</value>
160         <remarks>To be added.</remarks>
161         <summary>
162           <attribution license="cc4" from="Microsoft" modified="false" />
163           <para>Gets or sets a value that indicates whether the property or field will be recomposed when exports with a matching contract have changed in the container.</para>
164         </summary>
165       </Docs>
166     </Member>
167     <Member MemberName="ContractName">
168       <MemberSignature Language="C#" Value="public string ContractName { get; }" />
169       <MemberSignature Language="ILAsm" Value=".property instance string ContractName" />
170       <MemberType>Property</MemberType>
171       <AssemblyInfo>
172         <AssemblyVersion>4.0.0.0</AssemblyVersion>
173       </AssemblyInfo>
174       <ReturnValue>
175         <ReturnType>System.String</ReturnType>
176       </ReturnValue>
177       <Docs>
178         <value>To be added.</value>
179         <remarks>To be added.</remarks>
180         <summary>
181           <attribution license="cc4" from="Microsoft" modified="false" />
182           <para>Gets the contract name of the export to import.</para>
183         </summary>
184       </Docs>
185     </Member>
186     <Member MemberName="ContractType">
187       <MemberSignature Language="C#" Value="public Type ContractType { get; }" />
188       <MemberSignature Language="ILAsm" Value=".property instance class System.Type ContractType" />
189       <MemberType>Property</MemberType>
190       <AssemblyInfo>
191         <AssemblyVersion>4.0.0.0</AssemblyVersion>
192       </AssemblyInfo>
193       <ReturnValue>
194         <ReturnType>System.Type</ReturnType>
195       </ReturnValue>
196       <Docs>
197         <value>To be added.</value>
198         <remarks>To be added.</remarks>
199         <summary>
200           <attribution license="cc4" from="Microsoft" modified="false" />
201           <para>Gets the type of the export to import.</para>
202         </summary>
203       </Docs>
204     </Member>
205     <Member MemberName="RequiredCreationPolicy">
206       <MemberSignature Language="C#" Value="public System.ComponentModel.Composition.CreationPolicy RequiredCreationPolicy { get; set; }" />
207       <MemberSignature Language="ILAsm" Value=".property instance valuetype System.ComponentModel.Composition.CreationPolicy RequiredCreationPolicy" />
208       <MemberType>Property</MemberType>
209       <AssemblyInfo>
210         <AssemblyVersion>4.0.0.0</AssemblyVersion>
211       </AssemblyInfo>
212       <ReturnValue>
213         <ReturnType>System.ComponentModel.Composition.CreationPolicy</ReturnType>
214       </ReturnValue>
215       <Docs>
216         <value>To be added.</value>
217         <remarks>To be added.</remarks>
218         <summary>
219           <attribution license="cc4" from="Microsoft" modified="false" />
220           <para>Gets or sets a value that indicates that the importer requires a specific <see cref="T:System.ComponentModel.Composition.CreationPolicy" /> for the exports used to satisfy this import. </para>
221         </summary>
222       </Docs>
223     </Member>
224     <Member MemberName="Source">
225       <MemberSignature Language="C#" Value="public System.ComponentModel.Composition.ImportSource Source { get; set; }" />
226       <MemberSignature Language="ILAsm" Value=".property instance valuetype System.ComponentModel.Composition.ImportSource Source" />
227       <MemberType>Property</MemberType>
228       <AssemblyInfo>
229         <AssemblyVersion>4.0.0.0</AssemblyVersion>
230       </AssemblyInfo>
231       <ReturnValue>
232         <ReturnType>System.ComponentModel.Composition.ImportSource</ReturnType>
233       </ReturnValue>
234       <Docs>
235         <value>To be added.</value>
236         <remarks>To be added.</remarks>
237         <summary>
238           <attribution license="cc4" from="Microsoft" modified="false" />
239           <para>Gets or sets a value that specifies the scopes from which this import may be satisfied.</para>
240         </summary>
241       </Docs>
242     </Member>
243     <Member MemberName="System.ComponentModel.Composition.IAttributedImport.Cardinality">
244       <MemberSignature Language="C#" Value="System.ComponentModel.Composition.Primitives.ImportCardinality System.ComponentModel.Composition.IAttributedImport.Cardinality { get; }" />
245       <MemberSignature Language="ILAsm" Value=".property instance valuetype System.ComponentModel.Composition.Primitives.ImportCardinality System.ComponentModel.Composition.IAttributedImport.Cardinality" />
246       <MemberType>Property</MemberType>
247       <AssemblyInfo>
248         <AssemblyVersion>4.0.0.0</AssemblyVersion>
249       </AssemblyInfo>
250       <ReturnValue>
251         <ReturnType>System.ComponentModel.Composition.Primitives.ImportCardinality</ReturnType>
252       </ReturnValue>
253       <Docs>
254         <summary>To be added.</summary>
255         <value>To be added.</value>
256         <remarks>To be added.</remarks>
257       </Docs>
258     </Member>
259   </Members>
260 </Type>