Skip to content

Commit

Permalink
[generator] Use AttributeManager.HasAttribute instead of Attribute.Is…
Browse files Browse the repository at this point in the history
…Defined. (#1784)

Attribute.IsDefined doesn't work with IKVM.

Generator diff: https://gist.github.com/rolfbjarne/412bb9c0e6327887a8d71f8f79951e24
  • Loading branch information
rolfbjarne authored Feb 28, 2017
1 parent d196a78 commit eafae17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit eafae17

Please sign in to comment.