3 types derived from Export
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogExport.cs (1)
12
private class CatalogExport :
Export
System\ComponentModel\Composition\Hosting\CatalogExportProvider.FactoryExport.cs (1)
13
internal abstract class FactoryExport :
Export
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (1)
29
private sealed class ScopeCatalogExport :
Export
, IDisposable
2 instantiations of Export
System.ComponentModel.Composition (2)
System\ComponentModel\Composition\AttributedModelServices.cs (1)
123
return batch.AddExport(new
Export
(contractName, metadata, () => exportedValue));
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
382
return new
Export
(export, () => GetExportedValue(part, export));
215 references to Export
System.ComponentModel.Composition (215)
System\ComponentModel\Composition\ExportServices.cs (10)
47
internal static Func<
Export
, object> CreateStronglyTypedLazyFactory(Type? exportType, Type? metadataViewType)
64
return (Func<
Export
, object>)Delegate.CreateDelegate(typeof(Func<
Export
, object>), genericMethod);
67
internal static Func<
Export
, Lazy<object, object>> CreateSemiStronglyTypedLazyFactory(Type? exportType, Type? metadataViewType)
76
return (Func<
Export
, Lazy<object, object>>)Delegate.CreateDelegate(typeof(Func<
Export
, Lazy<object, object>>), genericMethod);
79
internal static Lazy<T, M> CreateStronglyTypedLazyOfTM<T, M>(
Export
export)
98
internal static Lazy<T> CreateStronglyTypedLazyOfT<T>(
Export
export)
113
internal static Lazy<object?, object> CreateSemiStronglyTypedLazy<T, M>(
Export
export)
132
internal static T GetCastedExportedValue<T>(
Export
export)
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (8)
140
/// <see cref="
Export
"/> to get.</param>
144
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
153
/// it should return an empty <see cref="IEnumerable{T}"/> of <see cref="
Export
"/>.
156
protected override IEnumerable<
Export
> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
162
var exports = new List<
Export
>();
165
foreach (
var
export in provider.GetExports(definition, atomicComposition))
174
IEnumerable<
Export
>? allExports = null;
180
bool cardinalityCheckResult = provider.TryGetExports(definition, atomicComposition, out IEnumerable<
Export
>? exports);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (13)
32
protected override IEnumerable<
Export
> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
57
/// uses to produce <see cref="
Export
"/> objects.
106
/// uses to produce <see cref="
Export
"/> objects.
129
/// <see cref="
Export
"/> objects. The default is <see langword="null"/>.
282
/// <see cref="
Export
"/> to get.</param>
285
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
294
/// it should return an empty <see cref="IEnumerable{T}"/> of <see cref="
Export
"/>.
297
protected override IEnumerable<
Export
> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
307
_innerExportProvider.TryGetExports(definition, atomicComposition, out IEnumerable<
Export
>? exports);
311
private List<
Export
> InternalGetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
329
List<
Export
> exports = new List<
Export
>();
343
private
Export
CreateExport(ComposablePartDefinition partDefinition, ExportDefinition exportDefinition, bool isExportFactory, CreationPolicy importPolicy)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.FactoryExport.cs (4)
51
public abstract
Export
CreateExportProduct();
77
public
Export
CreateProductExport()
91
private readonly
Export
_export;
119
public override void SetImport(ImportDefinition definition, IEnumerable<
Export
> exports)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.PartCreatorExport.cs (1)
20
public override
Export
CreateExportProduct()
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (4)
24
public override
Export
CreateExportProduct()
33
private
Export
? _export;
56
Export
? export = childContainer.CatalogExportProvider.CreateExport(_scopeFactoryExport.UnderlyingPartDefinition, _scopeFactoryExport.UnderlyingExportDefinition, false, CreationPolicy.Any);
78
Export
? export;
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeManager.cs (3)
25
protected override IEnumerable<
Export
> GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
27
List<
Export
> exports = new List<
Export
>();
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (8)
105
/// <see cref="ComposablePartExportProvider"/> access to <see cref="
Export
"/> objects.
181
/// <see cref="
Export
"/> to get.</param>
185
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
194
/// it should return an empty <see cref="IEnumerable{T}"/> of <see cref="
Export
"/>.
197
protected override IEnumerable<
Export
>? GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
217
List<
Export
> exports = new List<
Export
>();
380
private
Export
CreateExport(ComposablePart part, ExportDefinition export)
System\ComponentModel\Composition\Hosting\CompositionBatch.cs (3)
152
/// The <see cref="
Export
"/> to add to the <see cref="CompositionBatch"/>.
155
/// A <see cref="ComposablePart"/> that can be used remove the <see cref="
Export
"/>
163
public ComposablePart AddExport(
Export
export)
System\ComponentModel\Composition\Hosting\CompositionBatch.SingleExportComposablePart.cs (3)
16
private readonly
Export
_export;
18
public SingleExportComposablePart(
Export
export)
52
public override void SetImport(ImportDefinition definition, IEnumerable<
Export
> exports)
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (33)
46
/// the <see cref="CompositionContainer"/> access to <see cref="
Export
"/> objects,
67
/// the <see cref="CompositionContainer"/> access to <see cref="
Export
"/> objects,
83
/// <param name="catalog">A catalog that provides <see cref="
Export
"/> objects to the <see cref="CompositionContainer"/>.</param>
86
/// the <see cref="CompositionContainer"/> access to <see cref="
Export
"/> objects,
102
/// <param name="catalog">A catalog that provides <see cref="
Export
"/> objects to the <see cref="CompositionContainer"/>.</param>
108
/// the <see cref="CompositionContainer"/> access to <see cref="
Export
"/> objects,
124
/// <param name="catalog">A catalog that provides <see cref="
Export
"/> objects to the <see cref="CompositionContainer"/>.</param>
130
/// the <see cref="CompositionContainer"/> access to <see cref="
Export
"/> objects,
276
/// <see cref="
Export
"/> objects. The default is an empty
377
/// Releases the <see cref="
Export
"/> from the <see cref="CompositionContainer"/>. The behavior
379
/// the <see cref="
Export
"/> instance. As a general rule non shared exports should be early
383
/// an <see cref="
Export
"/> if it comes from a <see cref="ComposablePart"/> that was constructed
385
/// the dependency chain of the <see cref="
Export
"/>s, detaching references from the container and
386
/// calling Dispose on the <see cref="ComposablePart"/>s as needed. If the <see cref="
Export
"/>
391
/// <param name="export"><see cref="
Export
"/> that needs to be released.</param>
395
public void ReleaseExport(
Export
export)
408
/// the <see cref="
Export
"/> instance. As a general rule non shared exports should be early
414
/// the dependency chain of the <see cref="
Export
"/>s, detaching references from the container and
415
/// calling Dispose on the <see cref="ComposablePart"/>s as needed. If the <see cref="
Export
"/>
420
/// <param name="export"><see cref="
Export
"/> that needs to be released.</param>
435
/// Releases a set of <see cref="
Export
"/>s from the <see cref="CompositionContainer"/>.
438
/// <param name="exports"><see cref="
Export
"/>s that need to be released.</param>
445
public void ReleaseExports(IEnumerable<
Export
> exports)
449
foreach (
Export
export in exports)
456
/// Releases a set of <see cref="
Export
"/>s from the <see cref="CompositionContainer"/>.
459
/// <param name="exports"><see cref="
Export
"/>s that need to be released.</param>
477
/// Releases a set of <see cref="
Export
"/>s from the <see cref="CompositionContainer"/>.
480
/// <param name="exports"><see cref="
Export
"/>s that need to be released.</param>
550
/// <see cref="
Export
"/> to get.</param>
554
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
563
/// it should return an empty <see cref="IEnumerable{T}"/> of <see cref="
Export
"/>.
566
protected override IEnumerable<
Export
>? GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition)
570
IEnumerable<
Export
>? exports = null;
System\ComponentModel\Composition\Hosting\ExportProvider.cs (23)
14
/// methods for retrieving <see cref="
Export
"/> objects.
40
/// <see cref="
Export
"/> objects to get.
43
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
53
/// there are zero <see cref="
Export
"/> objects that match the conditions of the specified
59
/// <see cref="ImportCardinality.ExactlyOne"/> and there are more than one <see cref="
Export
"/>
63
public IEnumerable<
Export
> GetExports(ImportDefinition definition)
73
/// <see cref="
Export
"/> objects to get.
77
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
87
/// there are zero <see cref="
Export
"/> objects that match the conditions of the specified
93
/// <see cref="ImportCardinality.ExactlyOne"/> and there are more than one <see cref="
Export
"/>
97
public IEnumerable<
Export
> GetExports(ImportDefinition definition, AtomicComposition? atomicComposition)
101
ExportCardinalityCheckResult result = TryGetExportsCore(definition, atomicComposition, out IEnumerable<
Export
>? exports);
123
/// <see cref="
Export
"/> objects to get.
127
/// When this method returns, contains an <see cref="IEnumerable{T}"/> of <see cref="
Export
"/>
134
/// there are zero <see cref="
Export
"/> objects that match the conditions of the specified
137
/// <see cref="ImportCardinality.ExactlyOne"/> and there is exactly one <see cref="
Export
"/>
144
public bool TryGetExports(ImportDefinition definition, AtomicComposition? atomicComposition, out IEnumerable<
Export
>? exports)
157
/// <see cref="
Export
"/> objects to return.
161
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects that match
170
/// and there are zero <see cref="
Export
"/> objects that match the conditions of the
174
protected abstract IEnumerable<
Export
>? GetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition);
208
private ExportCardinalityCheckResult TryGetExportsCore(ImportDefinition definition, AtomicComposition? atomicComposition, out IEnumerable<
Export
>? exports)
227
exports ??= Array.Empty<
Export
>();
System\ComponentModel\Composition\Hosting\ExportProvider.GetExportOverrides.cs (17)
220
/// The <see cref="Type"/> of the <see cref="
Export
"/> objects to return.
223
/// The <see cref="Type"/> of the metadata view of the <see cref="
Export
"/> objects to
228
/// <see cref="
Export
"/> object to return; or <see langword="null"/>
238
/// The returned <see cref="
Export
"/> objects are instances of
263
IEnumerable<
Export
> exports = GetExportsCore(type, metadataViewType, contractName, ImportCardinality.ZeroOrMore);
266
Func<
Export
, Lazy<object, object>> typedExportFactory = ExportServices.CreateSemiStronglyTypedLazyFactory(type, metadataViewType);
267
foreach (
Export
export in exports)
713
IEnumerable<
Export
> exports = GetExportsCore(typeof(T), (Type?)null, contractName, ImportCardinality.ZeroOrMore);
716
foreach (
Export
export in exports)
730
Export
? export = GetExportsCore(typeof(T), (Type?)null, contractName, cardinality).SingleOrDefault();
737
IEnumerable<
Export
> exports = GetExportsCore(typeof(T), (Type?)null, contractName, ImportCardinality.ZeroOrMore);
740
foreach (
Export
export in exports)
749
IEnumerable<
Export
> exports = GetExportsCore(typeof(T), typeof(TMetadataView), contractName, ImportCardinality.ZeroOrMore);
752
foreach (
Export
export in exports)
761
Export
? export = GetExportsCore(typeof(T), typeof(TMetadataView), contractName, ImportCardinality.ExactlyOne).SingleOrDefault();
768
Export
? export = GetExportsCore(typeof(T), null, contractName, ImportCardinality.ExactlyOne).SingleOrDefault();
773
private IEnumerable<
Export
> GetExportsCore(Type type, Type? metadataViewType, string? contractName, ImportCardinality cardinality)
System\ComponentModel\Composition\Hosting\ImportEngine.cs (7)
35
/// <see cref="ImportEngine"/> access to <see cref="
Export
"/>s.
215
/// <see cref="ComposablePart"/> and releases all the <see cref="
Export
"/>s used to
462
CompositionResult<IEnumerable<
Export
>> exportsResult = TryGetExports(
737
private static CompositionResult<IEnumerable<
Export
>> TryGetExports(ExportProvider? provider,
742
IEnumerable<
Export
>? exports = null;
747
return new CompositionResult<IEnumerable<
Export
>>(exports!);
754
return new CompositionResult<IEnumerable<
Export
>>(
System\ComponentModel\Composition\Hosting\ImportEngine.PartManager.cs (8)
21
private Dictionary<ImportDefinition,
Export
[]?>? _importCache;
71
public CompositionResult TrySetImport(ImportDefinition import,
Export
[] exports)
93
public void SetSavedImport(ImportDefinition import,
Export
[]? exports, AtomicComposition? atomicComposition)
105
_importCache ??= new Dictionary<ImportDefinition,
Export
[]?>();
109
public
Export
[]? GetSavedImport(ImportDefinition import)
111
Export
[]? exports = null;
137
public void UpdateDisposableDependencies(ImportDefinition import,
Export
[] exports)
142
foreach (
var
export in exports)
System\ComponentModel\Composition\ImportCardinalityMismatchException.cs (1)
12
/// does not match the cardinality of the <see cref="Primitives.
Export
"/> objects available in an
System\ComponentModel\Composition\Primitives\ComposablePart.cs (2)
167
/// An <see cref="IEnumerable{T}"/> of <see cref="
Export
"/> objects of which
206
public abstract void SetImport(ImportDefinition definition, IEnumerable<
Export
> exports);
System\ComponentModel\Composition\Primitives\CompositionElementExtensions.cs (1)
13
public static ICompositionElement ToElement(this
Export
export)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (10)
54
/// <see cref="
Export
"/> required by the <see cref="ContractBasedImportDefinition"/>.
62
/// the metadata names of the <see cref="
Export
"/> required by the
68
/// cardinality of the <see cref="
Export
"/> objects required by the
115
/// <see cref="
Export
"/> required by the <see cref="ContractBasedImportDefinition"/>.
123
/// the metadata names of the <see cref="
Export
"/> required by the
129
/// cardinality of the <see cref="
Export
"/> objects required by the
196
/// An <see cref="IEnumerable{T}"/> of pairs of metadata keys and types of the <see cref="
Export
"/> required by the
262
/// <see cref="ImportDefinition"/> to be satisfied by an <see cref="
Export
"/>.
279
/// A definition for a <see cref="
Export
"/> used to determine if it satisfies the
283
/// <see langword="True"/> if the <see cref="
Export
"/> satisfies the requirements for
System\ComponentModel\Composition\Primitives\Export.cs (18)
21
private volatile object? _exportedValue =
Export
._EmptyValue;
24
/// Initializes a new instance of the <see cref="
Export
"/> class.
37
/// Initializes a new instance of the <see cref="
Export
"/> class
42
/// <see cref="
Export
"/>.
46
/// <see cref="
Export
"/>. This allows the creation of the object to be delayed
64
/// Initializes a new instance of the <see cref="
Export
"/> class
69
/// <see cref="
Export
"/>.
73
/// <see cref="
Export
"/>; or <see langword="null"/> to set the
79
/// <see cref="
Export
"/>. This allows the creation of the object to be delayed.
97
/// Initializes a new instance of the <see cref="
Export
"/> class
102
/// <see cref="
Export
"/> satisfies.
106
/// <see cref="
Export
"/>. This allows the creation of the object to be delayed.
129
/// the <see cref="
Export
"/> satisfies.
158
/// <see cref="
Export
"/>.
183
/// The exported <see cref="object"/> of the <see cref="
Export
"/>.
202
if (_exportedValue ==
Export
._EmptyValue)
205
Interlocked.CompareExchange(ref _exportedValue, exportedValue,
Export
._EmptyValue);
216
/// The exported <see cref="object"/> of the <see cref="
Export
"/>.
System\ComponentModel\Composition\Primitives\ExportDefinition.cs (1)
11
/// Describes the contract that an <see cref="
Export
"/> object satisfies.
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 (8)
51
/// to be satisfied by an <see cref="
Export
"/>.
61
/// cardinality of the <see cref="
Export
"/> objects required by the
124
/// A <see cref="string"/> containing the contract name of the <see cref="
Export
"/>
174
/// cardinality of the <see cref="
Export
"/> objects required by the
190
/// <see cref="ImportDefinition"/> to be satisfied by an <see cref="
Export
"/>.
243
/// <see cref="ImportDefinition"/> can be satisfied by the given <see cref="
Export
"/>.
246
/// A definition for a <see cref="
Export
"/> used to determine if it satisfies the
250
/// <see langword="True"/> if the <see cref="
Export
"/> satisfies the requirements for
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.cs (6)
23
public Func<
Export
, object> CreateStronglyTypedExportFactoryFactory(Type exportType, Type? metadataViewType)
40
Func<
Export
, object> exportFactoryFactory = (Func<
Export
, object>)Delegate.CreateDelegate(typeof(Func<
Export
, object>), this, genericMethod);
44
private object CreateStronglyTypedExportFactoryOfT<T>(
Export
export)
57
private object CreateStronglyTypedExportFactoryOfTM<T, M>(
Export
export)
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.LifetimeContext.cs (3)
14
public static Tuple<T, Action> GetExportLifetimeContextFromExport<T>(
Export
export)
23
Export
exportProduct = scopeFactoryExport.CreateExportProduct();
32
Export
exportProduct = factoryExport.CreateExportProduct();
System\ComponentModel\Composition\ReflectionModel\ImportingItem.cs (5)
33
public object? CastExportsToImportType(
Export
[] exports)
45
private Array CastExportsToCollectionImportType(
Export
[] exports)
65
private object? CastExportsToSingleImportType(
Export
[] exports)
82
private object? CastSingleExportToImportType(Type type,
Export
export)
92
private object? Cast(Type type,
Export
export)
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (6)
21
private Func<
Export
, object>? _castSingleValue;
25
internal static Dictionary<Type, Func<
Export
, object>?>? _castSingleValueCache;
27
private static Dictionary<Type, Func<
Export
, object>?> CastSingleValueCache
31
return _castSingleValueCache ??= new Dictionary<Type, Func<
Export
, object>?>();
69
public Func<
Export
, object>? CastExport
163
private static bool TryGetCastFunction(Type genericType, bool isOpenGeneric, Type[] arguments, out Func<
Export
, object>? castFunction)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (5)
187
public override void SetImport(ImportDefinition definition, IEnumerable<
Export
> exports)
202
Export
[] exportsAsArray = exports.AsArray();
241
private void SetImport(ImportingItem item,
Export
[] exports)
392
private static void EnsureCardinality(ImportDefinition definition,
Export
[] exports)
500
value = import.CastExportsToImportType(Array.Empty<
Export
>());