I want to retrieve values from a tree stored in another system. For example:
GetValue("Vehicle.Car.Ford.Focus.Engine.Oil.Color")
To avoid typing errors and invalid keys, I want to check the name at compile time by creating an object or class with the tree structure in it:
GetValue(Vehicle.Car.Ford.Focus.Engine.Oil.Color)
Is there an easy way to do this in C# without creating classes for each tree node? Can I use anonymous classes or subclasses? Should I create the code automatically?