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