You can use Type.BaseType to traverse from the top-level type to the most base type until the base type reaches object.
Something like this:
abstract class A { }
class B : A { }
class C : B { }
public static void Main(string[] args)
{
var target = typeof(C);
var baseTypeNames = GetBaseTypes(target).Select(t => t.Name).ToArray();
Console.WriteLine(String.Join(" : ", baseTypeNames));
}
private static IEnumerable<Type> GetBaseTypes(Type target)
{
do
{
yield return target.BaseType;
target = target.BaseType;
} while (target != typeof(object));
}