I will start by explaining my scenario in code:
public class A { } public class B : A { } public class C : B { } public class D { } public c
This looks like a job for polymorphism, as opposed to a big switch statement with tests for specific classes.