> > I have interface IAbc,IDef
>
[quoted text clipped - 9 lines]
>
> > TIA
can you please shed some more light on it..
Ben Voigt [C++ MVP] - 06 Mar 2008 15:31 GMT
>>> I have interface IAbc,IDef
>>
[quoted text clipped - 11 lines]
>
> can you please shed some more light on it..
Actually, it looks like BindingFlags.FlattenHierarchy is only needed for
static members (which interfaces don't have), sorry about that.
Type.GetMethods specifically guarantees that non-static members of a base
class are returned, but doesn't mention interfaces. You can always iterate
though the interfaces returned by Type.GetInterfaces, though, to find the
interface members.
chrisrock2@gmail.com - 06 Mar 2008 15:38 GMT
> > > I have interface IAbc,IDef
>
[quoted text clipped - 13 lines]
>
> - Show quoted text -
I don't think FlattenHierarchy works with interfaces. Found this on
the MSDN boards:
ShowInterfaceMethods(typeof(myInterface));
ShowInterfaceMethods(Type iType)
{
foreach (MethodInfo mi in
iType.GetMethods(BindingFlags.Public | BindingFlags.Instance |
BindingFlags.FlattenHierarchy))
{
Console.Writeline(mi.Name);
}
foreach (Type IBase in iType.GetInterfaces())
{
GetInterfaceMethods(IBase);
}
}
parez - 06 Mar 2008 21:19 GMT
> > > I have interface IAbc,IDef
>
[quoted text clipped - 11 lines]
>
> can you please shed some more light on it..
Thanks both.. .I got what i wanted..
But is there a reason why I have to do that? Is it an oversight on ms
side?