public string GetValue(string selectedSetting) { MicrowaveSettings setting = (MicrowaveSettings)Enum.Parse(typeof(MicrowaveSettings), selectedSetting, true); switch (setting) { case MicrowaveSettings.Power: return(Power.ToString()); case MicrowaveSettings.Grill: return(Grill.ToString()); default: return(""); } }
public void DecrValue(string selectedSetting) { MicrowaveSettings setting = (MicrowaveSettings)Enum.Parse(typeof(MicrowaveSettings), selectedSetting, true); switch (setting) { case MicrowaveSettings.Power: Power -= 150; break; case MicrowaveSettings.Grill: GrillDown(); break; default: break; } }