views:

29

answers:

0

My purpose is to find out if a class implements an interface directly. In the below example class B implements interface IB and interface IB implements IA.

How to find out the inheritance hierarchy. When we view an type in Object Browser, it shows a detailed hierarchy. How can I achieve similar result.

interface IA
{
    string Member1 { get;set; }
}

interface IB : IA
{
    string Member2 { get; set; }
}

class B : IB
{
    public string Member1 { get; set; }
    public string Member2 { get; set; }
}

Reflector Screenshot

alt text

In the screenshot taken from reflector it shows the hierarchy of the interfaces as well.

How can I find out the interface hierarchy for a Type.