I have a tree structure
A -> B -> D -> Y
-> C -> X
-> X
I want to do an operation on all objects of class X, or all the children objects of class D (for example). I want to call start this operation from any node in the tree (ie recursively).
For e.g,
A.SetupDecorators();
(although I'm open to suggestions)
All classes inherit from a superclass.
Is there a nice OO solution for this without using reflection?
C# is preferred.