1 type derived from ImportDefinition
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (1)
20public class ContractBasedImportDefinition : ImportDefinition
206 references to ImportDefinition
System.ComponentModel.Composition (206)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (5)
24private List<ImportDefinition>? _imports; 67public IEnumerable<ImportDefinition> GetImports() 417private List<ImportDefinition> GetImportDefinitions() 419List<ImportDefinition> imports = new List<ImportDefinition>();
System\ComponentModel\Composition\ConstraintServices.cs (1)
186public static Expression<Func<ExportDefinition, bool>> CreatePartCreatorConstraint(Expression<Func<ExportDefinition, bool>> baseConstraint, ImportDefinition productImportDefinition)
System\ComponentModel\Composition\ErrorBuilder.cs (3)
10public static CompositionError PreventedByExistingImport(ComposablePart part, ImportDefinition import) 35public static CompositionError CreateImportCardinalityMismatch(ImportCardinalityMismatchException exception, ImportDefinition definition) 61public static CompositionError CreatePartCannotSetImport(ComposablePart part, ImportDefinition definition, Exception innerException)
System\ComponentModel\Composition\ExportServices.cs (1)
151internal static ExportCardinalityCheckResult CheckCardinality<T>(ImportDefinition definition, IEnumerable<T>? enumerable)
System\ComponentModel\Composition\Hosting\AggregateCatalog.cs (2)
104/// The <see cref="ImportDefinition"/> that defines the conditions of the 119public override IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (5)
30/// executing <see cref="ExportProvider.GetExports(ImportDefinition,AtomicComposition)"/>. 75/// executing <see cref="ExportProvider.GetExports(ImportDefinition,AtomicComposition)"/>. 139/// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the 145/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 156protected override IEnumerable<Export> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (2)
140/// The <see cref="ImportDefinition"/> that defines the conditions of the 155public override IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (2)
403/// The <see cref="ImportDefinition"/> that defines the conditions of the 425public override IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogChangeProxy.cs (1)
34ImportDefinition definition)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (6)
32protected override IEnumerable<Export> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition) 280/// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the 286/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 297protected override IEnumerable<Export> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition) 311private List<Export> InternalGetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition) 804foreach (var import in definition.ImportDefinitions.Where(ImportEngine.IsRequiredImportForPreview))
System\ComponentModel\Composition\Hosting\CatalogExportProvider.FactoryExport.cs (4)
67public override IEnumerable<ImportDefinition> ImportDefinitions 69get { return Enumerable.Empty<ImportDefinition>(); } 104public override IEnumerable<ImportDefinition> ImportDefinitions 119public override void SetImport(ImportDefinition definition, IEnumerable<Export> exports)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeManager.cs (5)
25protected override IEnumerable<Export> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition) 29ImportDefinition? queryImport = TranslateImport(definition); 78private static ImportDefinition? TranslateImport(ImportDefinition definition) 90ImportDefinition? result = null;
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (3)
180/// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the 186/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 197protected override IEnumerable<Export>? GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
System\ComponentModel\Composition\Hosting\CompositionBatch.SingleExportComposablePart.cs (3)
35public override IEnumerable<ImportDefinition> ImportDefinitions 37get { return Enumerable.Empty<ImportDefinition>(); } 52public override void SetImport(ImportDefinition definition, IEnumerable<Export> exports)
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (3)
549/// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the 555/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 566protected override IEnumerable<Export>? GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
System\ComponentModel\Composition\Hosting\CompositionScopeDefinition.cs (3)
158/// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the 179public override IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition) 187internal IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExportsFromPublicSurface(ImportDefinition definition)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
593internal static CreationPolicy GetRequiredCreationPolicy(this ImportDefinition definition)
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
507/// The <see cref="ImportDefinition"/> that defines the conditions of the 522public override IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
System\ComponentModel\Composition\Hosting\ExportProvider.cs (27)
39/// The <see cref="ImportDefinition"/> that defines the conditions of the 44/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 52/// <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ExactlyOne"/> and 54/// <see cref="ImportDefinition"/>. 58/// <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ZeroOrOne"/> or 60/// objects that match the conditions of the specified <see cref="ImportDefinition"/>. 63public IEnumerable<Export> GetExports(ImportDefinition definition) 72/// The <see cref="ImportDefinition"/> that defines the conditions of the 78/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 86/// <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ExactlyOne"/> and 88/// <see cref="ImportDefinition"/>. 92/// <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ZeroOrOne"/> or 94/// objects that match the conditions of the specified <see cref="ImportDefinition"/>. 97public IEnumerable<Export> GetExports(ImportDefinition definition, AtomicComposition? atomicComposition) 122/// The <see cref="ImportDefinition"/> that defines the conditions of the 128/// objects that match the conditions defined by <see cref="ImportDefinition"/>, if found; 132/// <see langword="true"/> if <see cref="ImportDefinition.Cardinality"/> is 135/// <see cref="ImportDefinition"/>. <see langword="true"/> if 136/// <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ZeroOrOne"/> or 138/// that matches the conditions of the specified <see cref="ImportDefinition"/>; otherwise, 144public bool TryGetExports(ImportDefinition definition, AtomicComposition? atomicComposition, out IEnumerable<Export>? exports) 156/// The <see cref="ImportDefinition"/> that defines the conditions of the 162/// the conditions defined by <see cref="ImportDefinition"/>, if found; otherwise, an 169/// if <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ExactlyOne"/> 171/// specified <see cref="ImportDefinition"/>, an <see cref="IEnumerable{T}"/> should be returned. 174protected abstract IEnumerable<Export>? GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition); 208private ExportCardinalityCheckResult TryGetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition, out IEnumerable<Export>? exports)
System\ComponentModel\Composition\Hosting\FilteredCatalog.cs (2)
128/// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the 149public override IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependenciesTraversal.cs (3)
17private readonly Func<ImportDefinition, bool> _importFilter; 20public DependenciesTraversal(FilteredCatalog catalog, Func<ImportDefinition, bool> importFilter) 62foreach (ImportDefinition import in part.ImportDefinitions.Where(_importFilter))
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependentsTraversal.cs (4)
23private readonly Func<ImportDefinition, bool> _importFilter; 26public DependentsTraversal(FilteredCatalog catalog, Func<ImportDefinition, bool> importFilter) 45foreach (var import in part.ImportDefinitions) 81foreach (ImportDefinition import in candidateReachablePart.ImportDefinitions.Where(_importFilter))
System\ComponentModel\Composition\Hosting\FilteredCatalog.Traversal.cs (2)
28public FilteredCatalog IncludeDependencies(Func<ImportDefinition, bool> importFilter) 51public FilteredCatalog IncludeDependents(Func<ImportDefinition, bool> importFilter)
System\ComponentModel\Composition\Hosting\ImportEngine.cs (6)
451IEnumerable<ImportDefinition> imports, AtomicComposition? atomicComposition) 456foreach (ImportDefinition import in imports) 541foreach (var import in affectedImports) 568ImportDefinition import, AtomicComposition? atomicComposition) 738ComposablePart part, ImportDefinition definition, AtomicComposition? atomicComposition) 759internal static bool IsRequiredImportForPreview(ImportDefinition import)
System\ComponentModel\Composition\Hosting\ImportEngine.PartManager.cs (9)
20private Dictionary<ImportDefinition, List<IDisposable>>? _importedDisposableExports; 21private Dictionary<ImportDefinition, Export[]?>? _importCache; 68return _importedContractNames ??= Part.ImportDefinitions.Select(import => import.ContractName ?? ImportDefinition.EmptyContractName).Distinct().ToArray(); 71public CompositionResult TrySetImport(ImportDefinition import, Export[] exports) 93public void SetSavedImport(ImportDefinition import, Export[]? exports, AtomicComposition? atomicComposition) 105_importCache ??= new Dictionary<ImportDefinition, Export[]?>(); 109public Export[]? GetSavedImport(ImportDefinition import) 137public void UpdateDisposableDependencies(ImportDefinition import, Export[] exports) 174_importedDisposableExports ??= new Dictionary<ImportDefinition, List<IDisposable>>();
System\ComponentModel\Composition\Hosting\ImportEngine.RecompositionManager.cs (3)
40parts.AddRange(GetPartsImporting(ImportDefinition.EmptyContractName)); 50public static IEnumerable<ImportDefinition> GetAffectedImports(ComposablePart part, IEnumerable<ExportDefinition> changedExports) 55private static bool IsAffectedImport(ImportDefinition import, IEnumerable<ExportDefinition> changedExports)
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (2)
15public static ImportDefinition RemoveImportSource(this ImportDefinition definition)
System\ComponentModel\Composition\Hosting\ScopingExtensions.cs (2)
47foreach (ImportDefinition import in part.ImportDefinitions) 72foreach (ImportDefinition import in part.ImportDefinitions)
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
287internal override IEnumerable<ComposablePartDefinition>? GetCandidateParts(ImportDefinition definition)
System\ComponentModel\Composition\ImportCardinalityMismatchException.cs (1)
11/// The exception that is thrown when the cardinality of a <see cref="Primitives.ImportDefinition"/>
System\ComponentModel\Composition\Primitives\ComposablePart.cs (9)
53/// An <see cref="IEnumerable{T}"/> of <see cref="ImportDefinition"/> objects describing 75public abstract IEnumerable<ImportDefinition> ImportDefinitions { get; } 148/// One or more pre-requisite imports, indicated by <see cref="ImportDefinition.IsPrerequisite"/>, 163/// One of the <see cref="ImportDefinition"/> objects from the 187/// <paramref name="exports"/> is empty and <see cref="ImportDefinition.Cardinality"/> is 193/// <see cref="ImportDefinition.Cardinality"/> is <see cref="ImportCardinality.ZeroOrOne"/> or 198/// <see cref="ImportDefinition.IsRecomposable"/> is <see langword="false"/>. 204/// An error occurred setting the import described by the <see cref="ImportDefinition"/>. 206public abstract void SetImport(ImportDefinition definition, IEnumerable<Export> exports);
System\ComponentModel\Composition\Primitives\ComposablePartCatalog.cs (3)
75/// The <see cref="ImportDefinition"/> that defines the conditions of the 97public virtual IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition) 120internal virtual IEnumerable<ComposablePartDefinition>? GetCandidateParts(ImportDefinition definition)
System\ComponentModel\Composition\Primitives\ComposablePartDefinition.cs (3)
49/// An <see cref="IEnumerable{T}"/> of <see cref="ImportDefinition"/> objects describing 61public abstract IEnumerable<ImportDefinition> ImportDefinitions { get; } 105internal virtual bool TryGetExports(ImportDefinition definition, out Tuple<ComposablePartDefinition, ExportDefinition>? singleMatch, out IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>>? multipleMatches)
System\ComponentModel\Composition\Primitives\CompositionElementExtensions.cs (1)
30public static ICompositionElement ToElement(this ImportDefinition definition)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (8)
36/// <see cref="ImportDefinition.ContractName"/>, <see cref="RequiredTypeIdentity"/>, 37/// <see cref="RequiredMetadata"/>, <see cref="ImportDefinition.Cardinality"/>, 38/// <see cref="ImportDefinition.IsPrerequisite"/>, <see cref="ImportDefinition.IsRecomposable"/> 262/// <see cref="ImportDefinition"/> to be satisfied by an <see cref="Export"/>. 267/// <see cref="ImportDefinition.ContractName"/>, <see cref="RequiredTypeIdentity"/>, 280/// requirements for this <see cref="ImportDefinition"/>. 284/// this <see cref="ImportDefinition"/>, otherwise returns <see langword="False"/>.
System\ComponentModel\Composition\Primitives\ImportCardinality.cs (4)
7/// Indicates the cardinality of the <see cref="Export"/> objects required by an <see cref="ImportDefinition"/>. 12/// Zero or one <see cref="Export"/> objects are required by an <see cref="ImportDefinition"/>. 17/// Exactly one <see cref="Export"/> object is required by an <see cref="ImportDefinition"/>. 22/// Zero or more <see cref="Export"/> objects are required by an <see cref="ImportDefinition"/>.
System\ComponentModel\Composition\Primitives\ImportDefinition.cs (14)
28/// Initializes a new instance of the <see cref="ImportDefinition"/> class. 43/// Initializes a new instance of the <see cref="ImportDefinition"/> class 50/// that defines the conditions that must be matched for the <see cref="ImportDefinition"/> 62/// <see cref="ImportDefinition"/>. 65/// <see langword="true"/> if the <see cref="ImportDefinition"/> can be satisfied 70/// <see langword="true"/> if the <see cref="ImportDefinition"/> is required to be 154/// If the <see cref="ImportDefinition"/> does not contain metadata 175/// <see cref="ImportDefinition"/>. The default is 190/// <see cref="ImportDefinition"/> to be satisfied by an <see cref="Export"/>. 218/// <see langword="true"/> if the <see cref="ImportDefinition"/> is required to be 231/// <see langword="true"/> if the <see cref="ImportDefinition"/> can be satisfied 243/// <see cref="ImportDefinition"/> can be satisfied by the given <see cref="Export"/>. 247/// requirements for this <see cref="ImportDefinition"/>. 251/// this <see cref="ImportDefinition"/>, otherwise returns <see langword="False"/>.
System\ComponentModel\Composition\Primitives\PrimitivesServices.cs (6)
17public static ImportDefinition GetProductImportDefinition(this ImportDefinition import) 29internal static IEnumerable<string> GetCandidateContractNames(this ImportDefinition import, ComposablePartDefinition part) 51internal static bool IsImportDependentOnPart(this ImportDefinition import, ComposablePartDefinition part, ExportDefinition export, bool expandGenerics) 64private static ImportDefinition TranslateImport(ImportDefinition import, ComposablePartDefinition part)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (8)
23private IEnumerable<ImportDefinition>? _imports; 262private List<ImportDefinition> PopulateImports(List<LazyMemberInfo> members, List<Lazy<ParameterInfo>> parameters) 264List<ImportDefinition> imports = new List<ImportDefinition>(); 266foreach (ImportDefinition originalImport in _originalPartCreationInfo.GetImports()) 281private ImportDefinition TranslateImport(ReflectionImportDefinition reflectionImport, List<LazyMemberInfo> members, List<Lazy<ParameterInfo>> parameters) 296ImportDefinition? import = null; 507public IEnumerable<ImportDefinition> GetImports()
System\ComponentModel\Composition\ReflectionModel\IReflectionPartCreationInfo.cs (1)
17IEnumerable<ImportDefinition> GetImports();
System\ComponentModel\Composition\ReflectionModel\PartCreatorExportDefinition.cs (1)
45internal static bool IsProductConstraintSatisfiedBy(ImportDefinition productImportDefinition, ExportDefinition exportDefinition)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (18)
19private volatile Dictionary<ImportDefinition, object?>? _importValues; 20private volatile Dictionary<ImportDefinition, ImportingItem>? _importsCache; 60private Dictionary<ImportDefinition, object?> ImportValues 72value = new Dictionary<ImportDefinition, object?>(); 81private Dictionary<ImportDefinition, ImportingItem> ImportsCache 93value = new Dictionary<ImportDefinition, ImportingItem>(); 131public sealed override IEnumerable<ImportDefinition> ImportDefinitions 187public override void SetImport(ImportDefinition definition, IEnumerable<Export> exports) 370foreach (ImportDefinition definition in ImportDefinitions.Where(definition => definition.IsPrerequisite)) 381private void EnsureSettable(ImportDefinition definition) 392private static void EnsureCardinality(ImportDefinition definition, Export[] exports) 448IEnumerable<ImportDefinition> members = ImportDefinitions.Where(import => !import.IsPrerequisite); 456IEnumerable<ImportDefinition> members = ImportDefinitions.Where(import => import.IsPrerequisite); 462private void SetExportedValueForImport(ImportingItem import, ImportDefinition definition, object value) 472where TImportDefinition : ImportDefinition 510private bool TryGetImportValue(ImportDefinition definition, out object? value) 583private ImportingItem? GetImportingItemFromDefinition(ImportDefinition definition) 597private static ImportingItem? GetImportingItem(ImportDefinition definition)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (5)
18private volatile ImportDefinition[]? _imports; 79public override IEnumerable<ImportDefinition> ImportDefinitions 85ImportDefinition[] imports = _creationInfo.GetImports().ToArray(); 141internal override bool TryGetExports(ImportDefinition definition, out Tuple<ComposablePartDefinition, ExportDefinition>? singleMatch, out IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>>? multipleMatches) 218private bool TryGetNonGenericExports(ImportDefinition definition, out Tuple<ComposablePartDefinition, ExportDefinition>? singleMatch, out IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>>? multipleMatches)
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (11)
58public static LazyMemberInfo GetImportingMember(ImportDefinition importDefinition) 73public static Lazy<ParameterInfo> GetImportingParameter(ImportDefinition importDefinition) 89public static bool IsImportingParameter(ImportDefinition importDefinition) 104public static bool IsExportFactoryImportDefinition(ImportDefinition importDefinition) 111public static ContractBasedImportDefinition GetExportFactoryProductImportDefinition(ImportDefinition importDefinition) 129Lazy<IEnumerable<ImportDefinition>>? imports, 320private readonly Lazy<IEnumerable<ImportDefinition>>? _imports; 330Lazy<IEnumerable<ImportDefinition>>? imports, 426public IEnumerable<ImportDefinition> GetImports() 433IEnumerable<ImportDefinition> imports = _imports.Value; 440foreach (ImportDefinition import in imports)