ExportAttribute Class
Specifies that a type, property, field, or method provides a particular export.
Assembly: System.Composition.AttributedModel (in System.Composition.AttributedModel.dll)
| Name | Description | |
|---|---|---|
![]() | ExportAttribute() | Initializes a new instance of the ExportAttribute class, exporting the type or member marked with this attribute under the default contract name. |
![]() | ExportAttribute(String^) | Initializes a new instance of the ExportAttribute class, exporting the type or member marked with this attribute under the specified contract name. |
![]() | ExportAttribute(String^, Type^) | Initializes a new instance of the ExportAttribute class, exporting the specified type under the specified contract name. |
![]() | ExportAttribute(Type^) | Initializes a new instance of the ExportAttribute class, exporting the type or member marked with this attribute under a contract name derived from the specified type. |
| Name | Description | |
|---|---|---|
![]() | ContractName | Gets the contract name that is used to export the type or member marked with this attribute. |
![]() | ContractType | Gets the contract type that is exported by the member that is marked by this attribute. |
![]() | TypeId | (Inherited from Attribute.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | (Inherited from Attribute.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Attribute.) |
![]() | GetType() | (Inherited from Object.) |
![]() | IsDefaultAttribute() | (Inherited from Attribute.) |
![]() | Match(Object^) | (Inherited from Attribute.) |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | ToString() | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | _Attribute::GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfo(UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfoCount(UInt32) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Inherited from Attribute.) |
In the attributed programming model, the ExportAttribute attribute declares that a part exports, or provides to the composition container, an object that fulfills a particular contract. During composition, parts with imports that have matching contracts have those dependencies filled by the exported object.
The ExportAttribute attribute can apply to either an entire class, or a property, field, or method of a class. If it's applied to the entire class, an instance of the class is the exported object. If it's applied to a member of a class, the exported object will be the value of that member.
Whether or not a contract matches is determined primarily by the contract name and the contract type. For more information, see the ImportAttribute reference.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




