Class CompositionConfiguration
- Namespace
- Microsoft.VisualStudio.Composition
- Assembly
- Microsoft.VisualStudio.Composition.dll
public class CompositionConfiguration
- Inheritance
-
CompositionConfiguration
- Inherited Members
Properties
Catalog
Gets the catalog that backs this configuration. This may be a smaller catalog than the one passed in to create this configuration if invalid parts were removed.
public ComposableCatalog Catalog { get; }
Property Value
CompositionErrors
Gets the compositional errors detected while creating this configuration that led to the removal of parts from the catalog backing this configuration.
public IImmutableStack<IReadOnlyCollection<ComposedPartDiagnostic>> CompositionErrors { get; }
Property Value
Remarks
The errors are collected as a stack. The topmost stack element represents the first level of errors detected. As errors are detected and parts removed to achieve a 'stable composition', each cycle of removing parts and detecting additional errors gets a deeper element in the stack. Therefore the 'root cause' of all failures is generally found in the topmost stack element.
MetadataViewsAndProviders
Gets a map of metadata views and their matching providers.
public IReadOnlyDictionary<Type, ExportDefinitionBinding> MetadataViewsAndProviders { get; }
Property Value
Parts
Gets the composed parts, with exports satisfied, that make up this configuration.
public ISet<ComposedPart> Parts { get; }
Property Value
Methods
Create(ComposableCatalog)
public static CompositionConfiguration Create(ComposableCatalog catalog)
Parameters
catalog
ComposableCatalog
Returns
CreateDgml()
public XDocument CreateDgml()
Returns
CreateExportProviderFactory()
public IExportProviderFactory CreateExportProviderFactory()
Returns
GetEffectiveSharingBoundary(ComposablePartDefinition)
public string? GetEffectiveSharingBoundary(ComposablePartDefinition partDefinition)
Parameters
partDefinition
ComposablePartDefinition
Returns
ThrowOnErrors()
Returns the configuration if it is valid, otherwise throws an exception describing any compositional failures.
public CompositionConfiguration ThrowOnErrors()
Returns
- CompositionConfiguration
This configuration.
Remarks
This method returns this
so that it may be used in a 'fluent API' expression.
Exceptions
- CompositionFailedException
Thrown if CompositionErrors is non-empty.