Vorrei creare una funzione che mi restituisca un tipo di dati a seconda del valore:

es:
codice:
public static Type GetValue(string name, string format)
{
        switch (format)
                {
                    case "Integer":
                        return  integer value
                    case "Boolean":
                        return boolean value
                    default:
                        return setting value
                }
}
è possibile implementare una funzione del genere???

Grazie mille