T
Tom Hundley
Scenario:
- I'm dumping an int value of myEnum into a table.
- I am getting that int value out of the table.
- I need to set myEnum equal to that int value
Easy enough:
private enum animals {cat=0, dog=1}
private animals myAnimal = (animals)1;
OK- so that works, and myAnimal is set to dog....
Problem:
I'm using reflection to go through a list of properties and am setting them
to their respective values from a table. My problem is that I need to
<<programmatically>> get type myAnimal.
private animals myAnimal = (System.Enum)1; //doesn't work
private animals myAnimal = 1; //doesn't work
private animals myAnimal = (programatically get type myAnimal)1; //this is
what I need
Anyone have any suggestions???
Thanks,
Tom
- I'm dumping an int value of myEnum into a table.
- I am getting that int value out of the table.
- I need to set myEnum equal to that int value
Easy enough:
private enum animals {cat=0, dog=1}
private animals myAnimal = (animals)1;
OK- so that works, and myAnimal is set to dog....
Problem:
I'm using reflection to go through a list of properties and am setting them
to their respective values from a table. My problem is that I need to
<<programmatically>> get type myAnimal.
private animals myAnimal = (System.Enum)1; //doesn't work
private animals myAnimal = 1; //doesn't work
private animals myAnimal = (programatically get type myAnimal)1; //this is
what I need
Anyone have any suggestions???
Thanks,
Tom