Auf Englisch lesen Bearbeiten

Teilen über


ImportManyAttribute Constructors

Definition

Initializes a new instance of the ImportManyAttribute class.

Overloads

ImportManyAttribute()

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the default contract name.

ImportManyAttribute(String)

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the specified contract name.

ImportManyAttribute(Type)

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the contract name derived from the specified type.

ImportManyAttribute(String, Type)

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the specified contract name and contract type.

ImportManyAttribute()

Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the default contract name.

C#
public ImportManyAttribute();

Remarks

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

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

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

ImportManyAttribute(String)

Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the specified contract name.

C#
public ImportManyAttribute(string? contractName);
C#
public ImportManyAttribute(string contractName);

Parameters

contractName
String

The contract name of the exports to import, 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, field, or parameter type that is marked with this attribute.

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

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

ImportManyAttribute(Type)

Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the contract name derived from the specified type.

C#
public ImportManyAttribute(Type? contractType);
C#
public ImportManyAttribute(Type contractType);

Parameters

contractType
Type

The type to derive the contract name of the exports to import, 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, field, or parameter type that is marked with this attribute.

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

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

ImportManyAttribute(String, Type)

Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs
Source:
ImportManyAttribute.cs

Initializes a new instance of the ImportManyAttribute class, importing the set of exports with the specified contract name and contract type.

C#
public ImportManyAttribute(string? contractName, Type? contractType);
C#
public ImportManyAttribute(string contractName, Type contractType);

Parameters

contractName
String

The contract name of the exports to import, or null or an empty string ("") to use the default contract name.

contractType
Type

The type of the export to import.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)