ExportAttribute Constructors

Definition

Initializes a new instance of the ExportAttribute class.

Overloads

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(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.

ExportAttribute(String, Type)

Initializes a new instance of the ExportAttribute class, exporting the specified type under the specified contract name.

ExportAttribute()

Source:
ExportAttribute.cs
Source:
ExportAttribute.cs
Source:
ExportAttribute.cs

Initializes a new instance of the ExportAttribute class, exporting the type or member marked with this attribute under the default contract name.

public:
 ExportAttribute();
public ExportAttribute ();
Public Sub New ()

Remarks

The default contract name is the result of calling the GetContractName method on the property or field type, or on the type that is marked with this attribute.

Methods marked with this attribute must specify a contract name or a type by using either ExportAttribute(String) or ExportAttribute(Type).

The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

Applies to

ExportAttribute(String)

Source:
ExportAttribute.cs
Source:
ExportAttribute.cs
Source:
ExportAttribute.cs

Initializes a new instance of the ExportAttribute class, exporting the type or member marked with this attribute under the specified contract name.

public:
 ExportAttribute(System::String ^ contractName);
public ExportAttribute (string contractName);
public ExportAttribute (string? contractName);
new System.ComponentModel.Composition.ExportAttribute : string -> System.ComponentModel.Composition.ExportAttribute
Public Sub New (contractName As String)

Parameters

contractName
String

The contract name that is used to export the type or member marked with this attribute, or null or an empty string ("") to use the default contract name.

Remarks

The default contract name is the result of calling the GetContractName method on the property or field type, or on the type that this is marked with this attribute.

Methods marked with this attribute must specify a contract name or a type by using either ExportAttribute(String) or ExportAttribute(Type).

The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

Applies to

ExportAttribute(Type)

Source:
ExportAttribute.cs
Source:
ExportAttribute.cs
Source:
ExportAttribute.cs

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.

public:
 ExportAttribute(Type ^ contractType);
public ExportAttribute (Type contractType);
public ExportAttribute (Type? contractType);
new System.ComponentModel.Composition.ExportAttribute : Type -> System.ComponentModel.Composition.ExportAttribute
Public Sub New (contractType As Type)

Parameters

contractType
Type

A type from which to derive the contract name that is used to export the type or member marked with this attribute, or null to use the default contract name.

Remarks

The contract name is the result of calling the GetContractName method on contractType.

The default contract name is the result of calling the GetContractName method on the property or field type, or on the type that is marked with this attribute.

Methods marked with this attribute must specify a contract name or a type by using either ExportAttribute(String) or ExportAttribute(Type).

The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.

Applies to

ExportAttribute(String, Type)

Source:
ExportAttribute.cs
Source:
ExportAttribute.cs
Source:
ExportAttribute.cs

Initializes a new instance of the ExportAttribute class, exporting the specified type under the specified contract name.

public:
 ExportAttribute(System::String ^ contractName, Type ^ contractType);
public ExportAttribute (string contractName, Type contractType);
public ExportAttribute (string? contractName, Type? contractType);
new System.ComponentModel.Composition.ExportAttribute : string * Type -> System.ComponentModel.Composition.ExportAttribute
Public Sub New (contractName As String, contractType As Type)

Parameters

contractName
String

The contract name that is used to export the type or member marked with this attribute, or null or an empty string ("") to use the default contract name.

contractType
Type

The type to export.

Remarks

The default contract name is the result of calling AttributedModelServices.GetContractName(Type) on the property or field type, or on the type itself that this is marked with this attribute.

The contract name is compared using a case-sensitive, non-linguistic comparison using StringComparer.Ordinal.

Applies to