Browse Source

Fixed issue caused by Type.GetMethods not including inherited interfaces. Still not working right though.

git-svn-id: https://mono-soc-2010.googlecode.com/svn/trunk/cppinterop@9 a470b8cb-0e6f-1642-1b45-71e107334c4b
pull/1/head
alexander.corrado 15 years ago
parent
commit
d2706405b4
  1. 23
      Mono.VisualC.Interop/ABI/CppAbi.cs

23
Mono.VisualC.Interop/ABI/CppAbi.cs

@ -42,7 +42,18 @@ namespace Mono.VisualC.Interop.ABI { @@ -42,7 +42,18 @@ namespace Mono.VisualC.Interop.ABI {
this.layoutType = typeof (NLayout);
this.wrapperType = wrapperType;
MethodInfo[] methods = interfaceType.GetMethods ();
DefineImplType ();
var methods = ( // get all methods defined on the interface
from method in interfaceType.GetMethods ()
orderby method.MetadataToken
select method
).Union( // ... as well as those defined on inherited interfaces
from iface in interfaceType.GetInterfaces ()
from method in iface.GetMethods ()
select method
);
var managedOverrides = from method in methods
where Modifiers.IsVirtual (method)
orderby method.MetadataToken
@ -52,19 +63,17 @@ namespace Mono.VisualC.Interop.ABI { @@ -52,19 +63,17 @@ namespace Mono.VisualC.Interop.ABI {
// Implement all methods
int vtableIndex = 0;
for (int i = 0; i < methods.Length; i++) {
foreach (var method in methods) {
// Skip over special methods like property accessors -- properties will be handled later
if (methods [i].IsSpecialName)
if (method.IsSpecialName)
continue;
DefineMethod (methods [i], vtableIndex);
DefineMethod (method, vtableIndex);
if (Modifiers.IsVirtual (methods [i]))
if (Modifiers.IsVirtual (method))
vtableIndex++;
}
DefineImplType ();
// Implement all properties
foreach (var property in interfaceType.GetProperties ())
DefineFieldProperty (property);

Loading…
Cancel
Save