public void SetNthMask(int index, object obj) { WeatherColors_FieldIndex enu = (WeatherColors_FieldIndex)index; switch (enu) { case WeatherColors_FieldIndex.Sunrise: this.Sunrise = (Exception?)obj; break; case WeatherColors_FieldIndex.Day: this.Day = (Exception?)obj; break; case WeatherColors_FieldIndex.Sunset: this.Sunset = (Exception?)obj; break; case WeatherColors_FieldIndex.Night: this.Night = (Exception?)obj; break; default: throw new ArgumentException($"Index is out of range: {index}"); } }
public object?GetNthMask(int index) { WeatherColors_FieldIndex enu = (WeatherColors_FieldIndex)index; switch (enu) { case WeatherColors_FieldIndex.Sunrise: return(Sunrise); case WeatherColors_FieldIndex.Day: return(Day); case WeatherColors_FieldIndex.Sunset: return(Sunset); case WeatherColors_FieldIndex.Night: return(Night); default: throw new ArgumentException($"Index is out of range: {index}"); } }