61 references to CompositionConstants
System.ComponentModel.Composition (61)
System\ComponentModel\Composition\AttributedModel\AttributedExportDefinition.cs (4)
46
metadata.Add(
CompositionConstants
.ExportTypeIdentityMetadataName, typeIdentity);
49
if (partMetadata != null && partMetadata.TryGetValue(
CompositionConstants
.PartCreationPolicyMetadataName, out object? value))
51
metadata.Add(
CompositionConstants
.PartCreationPolicyMetadataName, value);
56
metadata.Add(
CompositionConstants
.GenericExportParametersOrderMetadataName, GenericServices.GetGenericParametersOrder(_typeIdentityType));
System\ComponentModel\Composition\AttributedModelServices.cs (1)
121
metadata.Add(
CompositionConstants
.ExportTypeIdentityMetadataName, typeIdentity);
System\ComponentModel\Composition\ConstraintServices.cs (7)
99
Expression.Not(CreateMetadataContainsKeyExpression(parameter,
CompositionConstants
.PartCreationPolicyMetadataName)),
100
CreateMetadataValueEqualsExpression(parameter, CreationPolicy.Any,
CompositionConstants
.PartCreationPolicyMetadataName)),
101
CreateMetadataValueEqualsExpression(parameter, policy,
CompositionConstants
.PartCreationPolicyMetadataName));
113
CreateMetadataContainsKeyExpression(parameter,
CompositionConstants
.ExportTypeIdentityMetadataName),
114
CreateMetadataValueEqualsExpression(parameter, requiredTypeIdentity,
CompositionConstants
.ExportTypeIdentityMetadataName));
197
Expression.Constant(
CompositionConstants
.ProductDefinitionMetadataName));
203
Expression.Constant(
CompositionConstants
.ProductDefinitionMetadataName));
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogExport.cs (1)
65
CreationPolicy partPolicy = partDefinition.Metadata.GetValue<CreationPolicy>(
CompositionConstants
.PartCreationPolicyMetadataName);
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
572
if (!definition.Metadata.TryGetValue(
CompositionConstants
.ImportSourceMetadataName, out object? source))
System\ComponentModel\Composition\Hosting\CompositionServices.cs (10)
23
CompositionConstants
.PartCreationPolicyMetadataName
191
dictionary.Add(
CompositionConstants
.PartCreationPolicyMetadataName, creationPolicy);
210
dictionary.Add(
CompositionConstants
.IsGenericPartMetadataName, true);
214
dictionary.Add(
CompositionConstants
.GenericPartArityMetadataName, genericArguments.Length);
242
dictionary.Add(
CompositionConstants
.GenericParameterConstraintsMetadataName, genericParameterConstraints);
243
dictionary.Add(
CompositionConstants
.GenericParameterAttributesMetadataName, genericParameterAttributes);
506
metadata[
CompositionConstants
.GenericImportParametersOrderMetadataName] = GenericServices.GetGenericParametersOrder(type);
510
metadata[
CompositionConstants
.GenericContractMetadataName] = ContractNameServices.GetTypeIdentity(type.GetGenericTypeDefinition());
511
metadata[
CompositionConstants
.GenericParametersMetadataName] = type.GetGenericArguments();
519
metadata[
CompositionConstants
.ImportSourceMetadataName] = attributedImport.Source;
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
54
reply.Remove(
CompositionConstants
.ImportSourceMetadataName);
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
297
string? genericContractName = definition.Metadata.GetValue<string>(
CompositionConstants
.GenericContractMetadataName);
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (2)
311
string? exportTypeIdentity = definition.Metadata.GetValue<string>(
CompositionConstants
.ExportTypeIdentityMetadataName);
355
CreationPolicy exportPolicy = definition.Metadata.GetValue<CreationPolicy>(
CompositionConstants
.PartCreationPolicyMetadataName);
System\ComponentModel\Composition\Primitives\PrimitivesServices.cs (6)
14
return part.Metadata.GetValue<bool>(
CompositionConstants
.IsGenericPartMetadataName);
33
string? genericContractName = import.Metadata.GetValue<string>(
CompositionConstants
.GenericContractMetadataName);
34
int[]? importParametersOrder = import.Metadata.GetValue<int[]>(
CompositionConstants
.GenericImportParametersOrderMetadataName);
37
int partArity = part.Metadata.GetValue<int>(
CompositionConstants
.GenericPartArityMetadataName);
72
int[]? importParametersOrder = contractBasedImport.Metadata.GetValue<int[]>(
CompositionConstants
.GenericImportParametersOrderMetadataName);
78
int partArity = part.Metadata.GetValue<int>(
CompositionConstants
.GenericPartArityMetadataName);
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (16)
101
originalMetadata.Remove(
CompositionConstants
.IsGenericPartMetadataName);
102
originalMetadata.Remove(
CompositionConstants
.GenericPartArityMetadataName);
103
originalMetadata.Remove(
CompositionConstants
.GenericParameterConstraintsMetadataName);
104
originalMetadata.Remove(
CompositionConstants
.GenericParameterAttributesMetadataName);
405
string contractName = Translate(reflectionExport.ContractName, reflectionExport.Metadata.GetValue<int[]>(
CompositionConstants
.GenericExportParametersOrderMetadataName));
440
int[]? importParametersOrder = originalImport.Metadata.GetValue<int[]>(
CompositionConstants
.GenericImportParametersOrderMetadataName);
446
metadata[
CompositionConstants
.GenericContractMetadataName] = GenericServices.GetGenericName(originalImport.ContractName, importParametersOrder, _specialization.Length);
447
metadata[
CompositionConstants
.GenericParametersMetadataName] = GenericServices.Reorder(_specialization, importParametersOrder);
448
metadata.Remove(
CompositionConstants
.GenericImportParametersOrderMetadataName);
462
string? exportTypeIdentity = originalExport.Metadata.GetValue<string>(
CompositionConstants
.ExportTypeIdentityMetadataName);
465
metadata[
CompositionConstants
.ExportTypeIdentityMetadataName] = Translate(exportTypeIdentity, originalExport.Metadata.GetValue<int[]>(
CompositionConstants
.GenericExportParametersOrderMetadataName));
467
metadata.Remove(
CompositionConstants
.GenericExportParametersOrderMetadataName);
549
int partArity = partMetadata.GetValue<int>(
CompositionConstants
.GenericPartArityMetadataName);
556
object[]? genericParameterConstraints = partMetadata.GetValue<object[]>(
CompositionConstants
.GenericParameterConstraintsMetadataName);
557
GenericParameterAttributes[]? genericParameterAttributes = partMetadata.GetValue<GenericParameterAttributes[]>(
CompositionConstants
.GenericParameterAttributesMetadataName);
System\ComponentModel\Composition\ReflectionModel\PartCreatorExportDefinition.cs (5)
25
return
CompositionConstants
.PartCreatorContractName;
36
metadata[
CompositionConstants
.ExportTypeIdentityMetadataName] =
CompositionConstants
.PartCreatorTypeIdentity;
37
metadata[
CompositionConstants
.ProductDefinitionMetadataName] = _productDefinition;
47
if (exportDefinition.Metadata.TryGetValue(
CompositionConstants
.ProductDefinitionMetadataName, out object? productValue))
System\ComponentModel\Composition\ReflectionModel\PartCreatorMemberImportDefinition.cs (2)
19
: base(importingLazyMember,
CompositionConstants
.PartCreatorContractName,
CompositionConstants
.PartCreatorTypeIdentity,
System\ComponentModel\Composition\ReflectionModel\PartCreatorParameterImportDefinition.cs (2)
20
: base(importingLazyParameter,
CompositionConstants
.PartCreatorContractName,
CompositionConstants
.PartCreatorTypeIdentity,
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (2)
150
var genericParameters = (definition.Metadata.Count > 0) ? definition.Metadata.GetValue<IEnumerable<object>>(
CompositionConstants
.GenericParametersMetadataName) : null;
269
var genericParametersOrder = export.Metadata.GetValue<int[]>(
CompositionConstants
.GenericExportParametersOrderMetadataName);