How do I dynamically reference incremented properties in C#?
- by Jeff Blankenburg
I have properties called reel1, reel2, reel3, and reel4. How can I dynamically reference these properties by just passing an integer (1-4) to my method?
Specifically, I am looking for how to get an object reference without knowing the name of the object.
In Javascript, I would do:
temp = eval("reel" + tempInt);
and temp would be equal to reel1, the object.
Can't seem to figure this simple concept out in C#.