Question : Using System.Type in switch()

Hello, I am attempting to create a method which will convert the text contained in an enum into a string value which I can display.  Im attempting to do this with a single method but I have many different enums I need to do this for.  The code below flags an error at switch(enumObj.BaseType).  What is the correct way to do this?

Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
public static class EnumerationTools
    {
        public static string ConvertEnumtoDisplayString(System.Type enumObj, int value)
        {
            string returnVal;

            switch (enumObj.BaseType)
            {
                case EnumTypeHere:
                    switch (value)
                    {
                        case 0:
                            returnVal = "Some Value";
                        case 1:
                            returnVal = "Some Value";
                        case 2:
                            returnVal = "Some Value";
                    }
                case EnumTypeHere:
                    switch (value)
                    {
                        case 0:
                            returnVal = "Some Value";
                        case 1:
                            returnVal = "Some Value";
                        case 2:
                            returnVal = "Some Value";
                    }
            }


            return returnVal;
        }
    }

Answer : Using System.Type in switch()

You should be able to see options to assign points, or split points after each answer. IF you want to split, chose the split option and then you will be given the option to assign the number of points in the split.
Random Solutions  
 
programming4us programming4us