From eafae17d2d367755a736ce9001b95149a8874732 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 28 Feb 2017 20:25:14 +0100 Subject: [PATCH] [generator] Use AttributeManager.HasAttribute instead of Attribute.IsDefined. (#1784) Attribute.IsDefined doesn't work with IKVM. Generator diff: https://gist.github.com/rolfbjarne/412bb9c0e6327887a8d71f8f79951e24 --- src/generator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generator.cs b/src/generator.cs index eac2a63cc54f..e8b5962e3601 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -107,7 +107,7 @@ public static AvailabilityBaseAttribute GetAvailability (this ICustomAttributePr string nwrap; if (parent_type != TypeManager.NSObject) { - if (Attribute.IsDefined (parent_type, TypeManager.ModelAttribute, false)) { + if (AttributeManager.HasAttribute (parent_type, TypeManager.ModelAttribute, false)) { foreach (PropertyInfo pinfo in parent_type.GetProperties (flags)) { bool toadd = true; var modelea = Generator.GetExportAttribute (pinfo, out nwrap); @@ -166,7 +166,7 @@ public static bool IsInternal (this Type type) Type parent_type = GetBaseType (type); if (parent_type != TypeManager.NSObject) { - if (Attribute.IsDefined (parent_type, TypeManager.ModelAttribute, false)) + if (AttributeManager.HasAttribute (parent_type, TypeManager.ModelAttribute, false)) foreach (MethodInfo minfo in parent_type.GetMethods ()) if (AttributeManager.HasAttribute (minfo, TypeManager.ExportAttribute, false)) methods.Add (minfo);