System\ComponentModel\Composition\Hosting\ExportProvider.GetExportOverrides.cs (11)
263IEnumerable<Export> exports = GetExportsCore(type, metadataViewType, contractName, ImportCardinality.ZeroOrMore);
528return GetExportedValueCore<T>(contractName, ImportCardinality.ExactlyOne);
628return GetExportedValueCore<T>(contractName, ImportCardinality.ZeroOrOne);
713IEnumerable<Export> exports = GetExportsCore(typeof(T), (Type?)null, contractName, ImportCardinality.ZeroOrMore);
723private T? GetExportedValueCore<T>(string? contractName, ImportCardinality cardinality)
737IEnumerable<Export> exports = GetExportsCore(typeof(T), (Type?)null, contractName, ImportCardinality.ZeroOrMore);
749IEnumerable<Export> exports = GetExportsCore(typeof(T), typeof(TMetadataView), contractName, ImportCardinality.ZeroOrMore);
761Export? export = GetExportsCore(typeof(T), typeof(TMetadataView), contractName, ImportCardinality.ExactlyOne).SingleOrDefault();
768Export? export = GetExportsCore(typeof(T), null, contractName, ImportCardinality.ExactlyOne).SingleOrDefault();
773private IEnumerable<Export> GetExportsCore(Type type, Type? metadataViewType, string? contractName, ImportCardinality cardinality)
794private static ContractBasedImportDefinition BuildImportDefinition(Type type, Type metadataViewType, string contractName, ImportCardinality cardinality)
System\ComponentModel\Composition\Primitives\ImportDefinition.cs (14)
20private readonly ImportCardinality _cardinality = ImportCardinality.ExactlyOne;
60/// One of the <see cref="ImportCardinality"/> values indicating the
78/// <paramref name="cardinality"/> is not one of the <see cref="ImportCardinality"/>
81public ImportDefinition(Expression<Func<ExportDefinition, bool>> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite)
89public ImportDefinition(Expression<Func<ExportDefinition, bool>> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, IDictionary<string, object?>? metadata)
97internal ImportDefinition(string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, IDictionary<string, object?>? metadata)
100(cardinality != ImportCardinality.ExactlyOne) &&
101(cardinality != ImportCardinality.ZeroOrMore) &&
102(cardinality != ImportCardinality.ZeroOrOne)
105throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_InvalidEnum, nameof(cardinality), cardinality, nameof(ImportCardinality)), nameof(cardinality));
173/// One of the <see cref="ImportCardinality"/> values indicating the
176/// <see cref="ImportCardinality.ExactlyOne"/>
178public virtual ImportCardinality Cardinality