Class ComposablePartDefinition
- Namespace
- Microsoft.VisualStudio.Composition
- Assembly
- Microsoft.VisualStudio.Composition.dll
public class ComposablePartDefinition : IEquatable<ComposablePartDefinition>
- Inheritance
-
ComposablePartDefinition
- Implements
- Inherited Members
Constructors
ComposablePartDefinition(TypeRef, IReadOnlyDictionary<string, object?>, IReadOnlyCollection<ExportDefinition>, IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>>, IEnumerable<ImportDefinitionBinding>, string?, IReadOnlyList<MethodRef>, MethodRef?, IReadOnlyList<ImportDefinitionBinding>?, CreationPolicy)
Initializes a new instance of the ComposablePartDefinition class.
public ComposablePartDefinition(TypeRef partType, IReadOnlyDictionary<string, object?> metadata, IReadOnlyCollection<ExportDefinition> exportedTypes, IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>> exportingMembers, IEnumerable<ImportDefinitionBinding> importingMembers, string? sharingBoundary, IReadOnlyList<MethodRef> onImportsSatisfiedMethods, MethodRef? importingConstructorRef, IReadOnlyList<ImportDefinitionBinding>? importingConstructorImports, CreationPolicy partCreationPolicy)
Parameters
partTypeTypeRefType of the part.
metadataIReadOnlyDictionary<string, object>The metadata discovered on the part.
exportedTypesIReadOnlyCollection<ExportDefinition>The exported types.
exportingMembersIReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>>The exporting members.
importingMembersIEnumerable<ImportDefinitionBinding>The importing members.
sharingBoundarystringThe sharing boundary that this part is shared within.
onImportsSatisfiedMethodsIReadOnlyList<MethodRef>The method to invoke after satisfying imports, if any.
importingConstructorRefMethodRefThe constructor to invoke to construct the part.
importingConstructorImportsIReadOnlyList<ImportDefinitionBinding>The importing arguments taken by the importing constructor. null if the part cannot be instantiated.
partCreationPolicyCreationPolicyThe creation policy for this part.
ComposablePartDefinition(TypeRef, IReadOnlyDictionary<string, object?>, IReadOnlyCollection<ExportDefinition>, IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>>, IEnumerable<ImportDefinitionBinding>, string?, IReadOnlyList<MethodRef>, MethodRef?, IReadOnlyList<ImportDefinitionBinding>?, CreationPolicy, bool)
Initializes a new instance of the ComposablePartDefinition class.
public ComposablePartDefinition(TypeRef partType, IReadOnlyDictionary<string, object?> metadata, IReadOnlyCollection<ExportDefinition> exportedTypes, IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>> exportingMembers, IEnumerable<ImportDefinitionBinding> importingMembers, string? sharingBoundary, IReadOnlyList<MethodRef> onImportsSatisfiedMethods, MethodRef? importingConstructorRef, IReadOnlyList<ImportDefinitionBinding>? importingConstructorImports, CreationPolicy partCreationPolicy, bool isSharingBoundaryInferred)
Parameters
partTypeTypeRefType of the part.
metadataIReadOnlyDictionary<string, object>The metadata discovered on the part.
exportedTypesIReadOnlyCollection<ExportDefinition>The exported types.
exportingMembersIReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>>The exporting members.
importingMembersIEnumerable<ImportDefinitionBinding>The importing members.
sharingBoundarystringThe sharing boundary that this part is shared within.
onImportsSatisfiedMethodsIReadOnlyList<MethodRef>The method to invoke after satisfying imports, if any.
importingConstructorRefMethodRefThe constructor to invoke to construct the part.
importingConstructorImportsIReadOnlyList<ImportDefinitionBinding>The importing arguments taken by the importing constructor. null if the part cannot be instantiated.
partCreationPolicyCreationPolicyThe creation policy for this part.
isSharingBoundaryInferredboolA value indicating whether the part does not have an explicit sharing boundary, and therefore can obtain its sharing boundary based on its imports.
ComposablePartDefinition(TypeRef, IReadOnlyDictionary<string, object?>, IReadOnlyCollection<ExportDefinition>, IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>>, IEnumerable<ImportDefinitionBinding>, string?, IReadOnlyList<MethodRef>, MethodRef?, IReadOnlyList<ImportDefinitionBinding>?, CreationPolicy, bool, IEnumerable<AssemblyName>)
Initializes a new instance of the ComposablePartDefinition class.
public ComposablePartDefinition(TypeRef partType, IReadOnlyDictionary<string, object?> metadata, IReadOnlyCollection<ExportDefinition> exportedTypes, IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>> exportingMembers, IEnumerable<ImportDefinitionBinding> importingMembers, string? sharingBoundary, IReadOnlyList<MethodRef> onImportsSatisfiedMethods, MethodRef? importingConstructorRef, IReadOnlyList<ImportDefinitionBinding>? importingConstructorImports, CreationPolicy partCreationPolicy, bool isSharingBoundaryInferred, IEnumerable<AssemblyName> extraInputAssemblies)
Parameters
partTypeTypeRefType of the part.
metadataIReadOnlyDictionary<string, object>The metadata discovered on the part.
exportedTypesIReadOnlyCollection<ExportDefinition>The exported types.
exportingMembersIReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>>The exporting members.
importingMembersIEnumerable<ImportDefinitionBinding>The importing members.
sharingBoundarystringThe sharing boundary that this part is shared within.
onImportsSatisfiedMethodsIReadOnlyList<MethodRef>The method to invoke after satisfying imports, if any.
importingConstructorRefMethodRefThe constructor to invoke to construct the part.
importingConstructorImportsIReadOnlyList<ImportDefinitionBinding>The importing arguments taken by the importing constructor. null if the part cannot be instantiated.
partCreationPolicyCreationPolicyThe creation policy for this part.
isSharingBoundaryInferredboolA value indicating whether the part does not have an explicit sharing boundary, and therefore can obtain its sharing boundary based on its imports.
extraInputAssembliesIEnumerable<AssemblyName>A sequence of extra assemblies to be added to the set for GetInputAssemblies(ISet<AssemblyName>, Func<Assembly, AssemblyName>).
Properties
CreationPolicy
public CreationPolicy CreationPolicy { get; }
Property Value
ExportDefinitions
Gets a sequence of all exports found on this part (both the type directly and its members).
public IEnumerable<KeyValuePair<MemberRef?, ExportDefinition>> ExportDefinitions { get; }
Property Value
ExportedTypes
Gets the types exported on the part itself.
public IReadOnlyCollection<ExportDefinition> ExportedTypes { get; }
Property Value
ExportingMembers
Gets the exports found on members of the part (exporting properties, fields, methods.)
public IReadOnlyDictionary<MemberRef, IReadOnlyCollection<ExportDefinition>> ExportingMembers { get; }
Property Value
ExtraInputAssemblies
Gets the sequence of extra input assemblies that will be added to the input assemblies for this ComposablePartDefinition.
public IEnumerable<AssemblyName> ExtraInputAssemblies { get; }
Property Value
Id
public string Id { get; }
Property Value
ImportingConstructorImports
Gets the list of parameters on the importing constructor, or null if the part cannot be instantiated.
public IReadOnlyList<ImportDefinitionBinding>? ImportingConstructorImports { get; }
Property Value
ImportingConstructorOrFactory
public MethodBase? ImportingConstructorOrFactory { get; }
Property Value
ImportingConstructorOrFactoryRef
public MethodRef? ImportingConstructorOrFactoryRef { get; }
Property Value
ImportingMembers
public ImmutableHashSet<ImportDefinitionBinding> ImportingMembers { get; }
Property Value
Imports
Gets a sequence of all imports found on this part (both members and importing constructor).
public IEnumerable<ImportDefinitionBinding> Imports { get; }
Property Value
IsInstantiable
public bool IsInstantiable { get; }
Property Value
IsShared
public bool IsShared { get; }
Property Value
IsSharingBoundaryInferred
Gets a value indicating whether the sharing boundary must be inferred from what is imported.
public bool IsSharingBoundaryInferred { get; }
Property Value
Remarks
This is true when the part was discovered by MEFv1 attributes, since these attributes do not have a way to convey a sharing boundary. This is false when the part is discovered by MEFv2 attributes, which have a SharedAttribute(string) that they can use to specify the value. When this is true, the SharingBoundary property is set to Empty.
Metadata
Gets the metadata for this part.
public IReadOnlyDictionary<string, object?> Metadata { get; }
Property Value
Remarks
This metadata has no effect on composition, but may be useful if the host wishes to filter a catalog based on part metadata prior to creating a composition.
OnImportsSatisfiedMethodRefs
Gets the list of methods to invoke after imports are satisfied.
public IReadOnlyList<MethodRef> OnImportsSatisfiedMethodRefs { get; }
Property Value
OnImportsSatisfiedMethods
Gets the list of methods to invoke after imports are satisfied.
public IEnumerable<MethodInfo> OnImportsSatisfiedMethods { get; }
Property Value
SharingBoundary
public string? SharingBoundary { get; }
Property Value
Type
public Type Type { get; }
Property Value
TypeRef
public TypeRef TypeRef { get; }
Property Value
Methods
Equals(ComposablePartDefinition?)
public bool Equals(ComposablePartDefinition? other)
Parameters
otherComposablePartDefinition
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString(TextWriter)
public void ToString(TextWriter writer)
Parameters
writerTextWriter