Change IsInheritableAttribute() to use new (filtered) model.

This commit is contained in:
jfrijters 2010-05-20 09:39:07 +00:00
Родитель 3a9ec6abef
Коммит a6c129ea68
1 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -523,18 +523,15 @@ namespace IKVM.Reflection
private static bool IsInheritableAttribute(Type attribute)
{
Type attributeUsageAttribute = attribute.Module.universe.Import(typeof(AttributeUsageAttribute));
foreach (CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(attribute))
IList<CustomAttributeData> attr = attribute.GetCustomAttributesData(attributeUsageAttribute);
if (attr.Count != 0)
{
if (cad.Constructor.DeclaringType.Equals(attributeUsageAttribute))
foreach (CustomAttributeNamedArgument named in attr[0].NamedArguments)
{
foreach (CustomAttributeNamedArgument named in cad.NamedArguments)
if (named.MemberInfo.Name == "Inherited")
{
if (named.MemberInfo.Name == "Inherited")
{
return (bool)named.TypedValue.Value;
}
return (bool)named.TypedValue.Value;
}
break;
}
}
return true;