public static void Project(ICustomAttributeProvider owner, CustomAttribute attribute)
{
if (!IsWindowsAttributeUsageAttribute (owner, attribute))
return;
var treatment = CustomAttributeValueTreatment.None;
var type = (TypeDefinition) owner;
if (type.Namespace == "Windows.Foundation.Metadata") {
if (type.Name == "VersionAttribute")
treatment = CustomAttributeValueTreatment.VersionAttribute;
else if (type.Name == "DeprecatedAttribute")
treatment = CustomAttributeValueTreatment.DeprecatedAttribute;
}
if (treatment == CustomAttributeValueTreatment.None) {
var multiple = HasAttribute (type, "Windows.Foundation.Metadata", "AllowMultipleAttribute");
treatment = multiple ? CustomAttributeValueTreatment.AllowMultiple : CustomAttributeValueTreatment.AllowSingle;
}
if (treatment != CustomAttributeValueTreatment.None) {
var attribute_targets = (AttributeTargets) attribute.ConstructorArguments [0].Value;
ApplyProjection (attribute, new CustomAttributeValueProjection (attribute_targets, treatment));
}
}