Hey, I think I have the wrong idea here, but I'm not sure which is better. I want a class with a member variable that can be of any type, depending on what is needed at the time. So far, I have something like this:
public class ConfigSetting<T> {
private T value;
public T GetValue() {
return value;
}
public void ChangeValue() {
}
public ConfigSetting(string heading, string key) {
this.value = DerivedMethods.configsettings.SettingGroups[heading].Settings[key].RawValue;
}
}
The type returned by the right side of the string 'this.value' is the string currently. I know that here it seems that I do not need to use anything other than a string type, but in the end I will parse the constructor, so that "this.value" can be a string, int, float or bool.
In any case, my compiler says: "It is not possible to convert" string "to" T ", so I assume that I am doing something very different.
Thanks.