I have an enum defined which stores multiple class names. Is there a way I can get the the type of an object given the enum value? The method GetObjectType when called with parameter Types.A should return the type of class A, how should it's body look like?
public class A
{
}
public class B
{
}
public enum Types
{
A = 1,
B = 2
}
public Type GetObjectType(Types type)
{
}
GetObjectType( (Types)0 )?AorB(within the enum), because we already know that the type isint. Also, theAandBthat you've declared inside the enum, have nothing to do with the classes that you've defined.