ReflectionModelServices.CreatePartDefinition Method

Definition

Creates a part definition with the specified part type, imports, exports, metadata, and origin.

C#
public static System.ComponentModel.Composition.Primitives.ComposablePartDefinition CreatePartDefinition(Lazy<Type> partType, bool isDisposalRequired, Lazy<System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ImportDefinition>>? imports, Lazy<System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition>>? exports, Lazy<System.Collections.Generic.IDictionary<string,object?>>? metadata, System.ComponentModel.Composition.Primitives.ICompositionElement? origin);
C#
public static System.ComponentModel.Composition.Primitives.ComposablePartDefinition CreatePartDefinition(Lazy<Type> partType, bool isDisposalRequired, Lazy<System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ImportDefinition>> imports, Lazy<System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition>> exports, Lazy<System.Collections.Generic.IDictionary<string,object>> metadata, System.ComponentModel.Composition.Primitives.ICompositionElement origin);

Parameters

partType
Lazy<Type>

The type of the part.

isDisposalRequired
Boolean

true if the part requires disposal; otherwise, false.

imports
Lazy<IEnumerable<ImportDefinition>>

A collection of the part's imports.

exports
Lazy<IEnumerable<ExportDefinition>>

A collection of the part's exports.

metadata
Lazy<IDictionary<String,Object>>

The part's metadata.

origin
ICompositionElement

The part's origin.

Returns

A part definition created from the specified parameters.

Applies to

Product Versions
.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)