ExportAttribute Constructors

Definition

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 ();

Remarks

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

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

Applies to

.NET 9 (package-provided) 及其他版本
產品 版本
.NET Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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 (string contractName);

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

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

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

Applies to

.NET 9 (package-provided) 及其他版本
產品 版本
.NET Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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);

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

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

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

Applies to

.NET 9 (package-provided) 及其他版本
產品 版本
.NET Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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 (string contractName, Type contractType);

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.

Applies to

.NET 9 (package-provided) 及其他版本
產品 版本
.NET Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)