On Mar 6, 10:08*am, parez <psaw...@gmail.comwrote:
On Mar 6, 9:43 am, "Ben Voigt [C++ MVP]" <r...@nospam.nospamwrote:
parez wrote:
*I have interface IAbc,IDef
and *interface *IXyz inherits/implements(what is the right word) IAbc
and IDef
if *i *reflect the type IXyz it only shows me the members of IXyz and
not IAbc and IDef.
Why?
Because you didn't use BindingFlags.FlattenHierarchy
TIA
can you please shed some more light on it..- Hide quoted text -
- 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);
}
}