99 references to CreationPolicy
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
StubVsServiceExporter`1.cs (1)
16
[PartCreationPolicy(
CreationPolicy
.NonShared)]
StubVsServiceExporter`2.cs (1)
23
[PartCreationPolicy(
CreationPolicy
.NonShared)]
System.ComponentModel.Composition (92)
System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs (2)
91
CreationPolicy
.NonShared,
128
CreationPolicy
.NonShared,
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (1)
174
private
CreationPolicy
CreationPolicy
System\ComponentModel\Composition\ConstraintServices.cs (5)
23
public static Expression<Func<ExportDefinition, bool>> CreateConstraint(string contractName, string? requiredTypeIdentity, IEnumerable<KeyValuePair<string, Type>> requiredMetadata,
CreationPolicy
requiredCreationPolicy)
45
if (requiredCreationPolicy !=
CreationPolicy
.Any)
84
private static BinaryExpression CreateCreationPolicyConstraint(
CreationPolicy
policy, ParameterExpression parameter)
88
if (policy ==
CreationPolicy
.Any)
100
CreateMetadataValueEqualsExpression(parameter,
CreationPolicy
.Any, CompositionConstants.PartCreationPolicyMetadataName)),
System\ComponentModel\Composition\CreationPolicy.cs (4)
13
/// Let the <see cref="Hosting.CompositionContainer"/> choose the most appropriate <see cref="
CreationPolicy
"/>
14
/// for the part given the current context. This is the default <see cref="
CreationPolicy
"/>, with
15
/// the <see cref="Hosting.CompositionContainer"/> choosing <see cref="
CreationPolicy
.Shared"/> by default
16
/// unless the <see cref="Primitives.ComposablePart"/> or importer requests <see cref="
CreationPolicy
.NonShared"/>.
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogExport.cs (12)
63
ComposablePartDefinition partDefinition, ExportDefinition definition,
CreationPolicy
importCreationPolicy)
65
CreationPolicy
partPolicy = partDefinition.Metadata.GetValue<
CreationPolicy
>(CompositionConstants.PartCreationPolicyMetadataName);
78
private static bool ShouldUseSharedPart(
CreationPolicy
partPolicy,
CreationPolicy
importPolicy)
88
case
CreationPolicy
.Any:
90
if (importPolicy ==
CreationPolicy
.Any ||
91
importPolicy ==
CreationPolicy
.Shared)
98
case
CreationPolicy
.NonShared:
100
if (importPolicy ==
CreationPolicy
.Shared)
109
if (partPolicy !=
CreationPolicy
.Shared || importPolicy ==
CreationPolicy
.NonShared)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (2)
327
CreationPolicy
importPolicy = definition.GetRequiredCreationPolicy();
343
private Export CreateExport(ComposablePartDefinition partDefinition, ExportDefinition exportDefinition, bool isExportFactory,
CreationPolicy
importPolicy)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (1)
56
Export? export = childContainer.CatalogExportProvider.CreateExport(_scopeFactoryExport.UnderlyingPartDefinition, _scopeFactoryExport.UnderlyingExportDefinition, false,
CreationPolicy
.Any);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeManager.cs (3)
94
case
CreationPolicy
.NonShared:
106
CreationPolicy
.Any,
110
case
CreationPolicy
.Any:
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (4)
384
/// under a <see cref="
CreationPolicy
.NonShared" /> context. Release in this context means walking
387
/// was constructed under a <see cref="
CreationPolicy
.Shared" /> context the
413
/// under a <see cref="
CreationPolicy
.NonShared" /> context. Release in this context means walking
416
/// was constructed under a <see cref="
CreationPolicy
.Shared" /> context the
System\ComponentModel\Composition\Hosting\CompositionServices.cs (4)
185
internal static IDictionary<string, object?> GetPartMetadataForType(this Type type,
CreationPolicy
creationPolicy)
189
if (creationPolicy !=
CreationPolicy
.Any)
593
internal static
CreationPolicy
GetRequiredCreationPolicy(this ImportDefinition definition)
600
return
CreationPolicy
.Any;
System\ComponentModel\Composition\Hosting\ExportProvider.GetExportOverrides.cs (1)
809
return new ContractBasedImportDefinition(contractName, requiredTypeIdentity, requiredMetadata, cardinality, false, true,
CreationPolicy
.Any, metadata);
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
108
public override
CreationPolicy
RequiredCreationPolicy
System\ComponentModel\Composition\IAttributedImport.cs (1)
13
CreationPolicy
RequiredCreationPolicy { get; }
System\ComponentModel\Composition\ImportAttribute.cs (6)
152
/// <see cref="
CreationPolicy
"/> for the exports used to satisfy this import. T
155
/// <see cref="
CreationPolicy
.Any"/> - default value, used if the importer doesn't
156
/// require a specific <see cref="
CreationPolicy
"/>.
158
/// <see cref="
CreationPolicy
.Shared"/> - Requires that all exports used should be shared
161
/// <see cref="
CreationPolicy
.NonShared"/> - Requires that all exports used should be
164
public
CreationPolicy
RequiredCreationPolicy { get; set; }
System\ComponentModel\Composition\ImportManyAttribute.cs (6)
130
/// <see cref="
CreationPolicy
"/> for the exports used to satisfy this import. T
133
/// <see cref="
CreationPolicy
.Any"/> - default value, used if the importer doesn't
134
/// require a specific <see cref="
CreationPolicy
"/>.
136
/// <see cref="
CreationPolicy
.Shared"/> - Requires that all exports used should be shared
139
/// <see cref="
CreationPolicy
.NonShared"/> - Requires that all exports used should be
142
public
CreationPolicy
RequiredCreationPolicy { get; set; }
System\ComponentModel\Composition\PartCreationPolicyAttribute.cs (5)
12
internal static readonly PartCreationPolicyAttribute Default = new PartCreationPolicyAttribute(
CreationPolicy
.Any);
13
internal static readonly PartCreationPolicyAttribute Shared = new PartCreationPolicyAttribute(
CreationPolicy
.Shared);
18
public PartCreationPolicyAttribute(
CreationPolicy
creationPolicy)
29
/// <see cref="System.ComponentModel.Composition.
CreationPolicy
.Any"/>.
31
public
CreationPolicy
CreationPolicy { get; }
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (21)
26
private readonly
CreationPolicy
_requiredCreationPolicy =
CreationPolicy
.Any;
82
/// A value indicating that the importer requires a specific <see cref="
CreationPolicy
"/> for
83
/// the exports used to satisfy this import. If no specific <see cref="
CreationPolicy
"/> is needed
84
/// pass the default <see cref="
CreationPolicy
.Any"/>.
102
ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite,
CreationPolicy
requiredCreationPolicy)
143
/// A value indicating that the importer requires a specific <see cref="
CreationPolicy
"/> for
144
/// the exports used to satisfy this import. If no specific <see cref="
CreationPolicy
"/> is needed
145
/// pass the default <see cref="
CreationPolicy
.Any"/>.
164
ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite,
CreationPolicy
requiredCreationPolicy, IDictionary<string, object?> metadata)
238
/// <see cref="
CreationPolicy
"/> for the exports used to satisfy this import. T
241
/// <see cref="
CreationPolicy
.Any"/> - default value, used if the importer doesn't
242
/// require a specific <see cref="
CreationPolicy
"/>.
244
/// <see cref="
CreationPolicy
.Shared"/> - Requires that all exports used should be shared
247
/// <see cref="
CreationPolicy
.NonShared"/> - Requires that all exports used should be
250
public virtual
CreationPolicy
RequiredCreationPolicy
350
if (RequiredCreationPolicy ==
CreationPolicy
.Any)
355
CreationPolicy
exportPolicy = definition.Metadata.GetValue<
CreationPolicy
>(CompositionConstants.PartCreationPolicyMetadataName);
356
return exportPolicy ==
CreationPolicy
.Any ||
366
if (_requiredCreationPolicy !=
CreationPolicy
.Any)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (2)
314
CreationPolicy
.NonShared,
357
CreationPolicy
.NonShared,
System\ComponentModel\Composition\ReflectionModel\PartCreatorParameterImportDefinition.cs (1)
21
productImportDefinition.RequiredMetadata, productImportDefinition.Cardinality,
CreationPolicy
.Any, MetadataServices.EmptyMetadata, origin)
System\ComponentModel\Composition\ReflectionModel\ReflectionImportDefinition.cs (1)
20
CreationPolicy
requiredCreationPolicy,
System\ComponentModel\Composition\ReflectionModel\ReflectionMemberImportDefinition.cs (1)
22
CreationPolicy
requiredCreationPolicy,
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (7)
168
CreationPolicy
requiredCreationPolicy,
181
CreationPolicy
requiredCreationPolicy,
208
CreationPolicy
requiredCreationPolicy,
228
CreationPolicy
.NonShared,
253
CreationPolicy
requiredCreationPolicy,
265
CreationPolicy
requiredCreationPolicy,
285
CreationPolicy
.NonShared,
System\ComponentModel\Composition\ReflectionModel\ReflectionParameterImportDefinition.cs (1)
22
CreationPolicy
requiredCreationPolicy,
System.ComponentModel.Composition.Registration (5)
System\ComponentModel\Composition\Registration\ImportBuilder.cs (2)
18
private
CreationPolicy
_requiredCreationPolicy;
59
public ImportBuilder RequiredCreationPolicy(
CreationPolicy
requiredCreationPolicy)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
17
private
CreationPolicy
_creationPolicy;
38
_creationPolicy =
CreationPolicy
.Any;
206
public PartBuilder SetCreationPolicy(
CreationPolicy
creationPolicy)