C# Class System.Composition.Convention.ImportConventionBuilder

显示文件 Open project: mikedn/runtime Class Usage Examples

Public Methods

Method Description
AddMetadataConstraint ( string name, Func getConstraintValueFromPartType ) : ImportConventionBuilder

Add an import constraint

AddMetadataConstraint ( string name, object value ) : ImportConventionBuilder

Add an import constraint

AllowDefault ( ) : ImportConventionBuilder

Allow the import to receive the default value for its type if the contract cannot be supplied by another part.

AsContractName ( Func getContractNameFromPartType ) : ImportConventionBuilder

Specify the contract name for the export.

AsContractName ( string contractName ) : ImportConventionBuilder

Specify the contract name for the import.

AsMany ( ) : ImportConventionBuilder

Configure the import to receive all exports of the contract.

AsMany ( bool isMany ) : ImportConventionBuilder

Configure the import to receive all exports of the contract.

Private Methods

Method Description
BuildAttributes ( Type type, List &attributes ) : void
ImportConventionBuilder ( ) : System.Collections.Generic
IsSupportedImportManyType ( TypeInfo typeInfo ) : bool

Method Details

AddMetadataConstraint() public method

Add an import constraint
public AddMetadataConstraint ( string name, Func getConstraintValueFromPartType ) : ImportConventionBuilder
name string The name of the constraint item.
getConstraintValueFromPartType Func A function that calculates the value to match.
return ImportConventionBuilder

AddMetadataConstraint() public method

Add an import constraint
public AddMetadataConstraint ( string name, object value ) : ImportConventionBuilder
name string The name of the constraint item.
value object The value to match.
return ImportConventionBuilder

AllowDefault() public method

Allow the import to receive the default value for its type if the contract cannot be supplied by another part.
public AllowDefault ( ) : ImportConventionBuilder
return ImportConventionBuilder

AsContractName() public method

Specify the contract name for the export.
public AsContractName ( Func getContractNameFromPartType ) : ImportConventionBuilder
getContractNameFromPartType Func A Func to retrieve the contract name from the part typeThe contract name.
return ImportConventionBuilder

AsContractName() public method

Specify the contract name for the import.
public AsContractName ( string contractName ) : ImportConventionBuilder
contractName string
return ImportConventionBuilder

AsMany() public method

Configure the import to receive all exports of the contract.
public AsMany ( ) : ImportConventionBuilder
return ImportConventionBuilder

AsMany() public method

Configure the import to receive all exports of the contract.
public AsMany ( bool isMany ) : ImportConventionBuilder
isMany bool True if the import receives all values; otherwise false.
return ImportConventionBuilder