return false;
if(!as_generator
- (scope_tab << scope_tab << "descs.Add(new Efl_Op_Description() {"
+ (scope_tab << scope_tab
+ << "if (methods.FirstOrDefault(m => m.Name == \"" << string << "\") != null)\n"
+ << scope_tab << scope_tab << scope_tab
+ << "descs.Add(new Efl_Op_Description() {"
#ifdef _WIN32
<< "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")"
#else
#endif
<< ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n"
)
- .generate(sink, std::make_tuple(f.c_name, f.c_name), context))
+ .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.c_name, f.c_name), context))
return false;
return true;
}
<< scope_tab << "public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "var descs = new System.Collections.Generic.List<Efl_Op_Description>();\n"
+ << scope_tab << scope_tab << "var methods = Efl.Eo.Globals.GetUserMethods(type);\n"
)
.generate(sink, attributes::unused, inative_cxt))
return false;
return null;
}
+ public static System.Collections.Generic.List<System.Reflection.MethodInfo>
+ GetUserMethods(System.Type type)
+ {
+ var r = new System.Collections.Generic.List<System.Reflection.MethodInfo>();
+ r.AddRange(type.GetMethods());
+ var base_type = type.BaseType;
+
+ for (;base_type != null; base_type = base_type.BaseType)
+ {
+ var attrs = System.Attribute.GetCustomAttributes(type);
+ foreach (var attr in attrs)
+ {
+ if (attr is Efl.Eo.NativeClass)
+ {
+ return r;
+ }
+ }
+
+ r.AddRange(base_type.GetMethods());
+ }
+ return r;
+ }
+
public static byte class_initializer_call(IntPtr klass, System.Type type)
{
Eina.Log.Debug($"called with 0x{klass.ToInt64():x} {type}");