Exemplo n.º 1
0
 public MainForm()
 {
     WeatherRate.GetWeatherRate();
     Territory.GetTerritory();
     ThisForm = this;
     InitializeComponent();
 }
Exemplo n.º 2
0
        private static string Forcast(int fI, WeatherRate wR)
        {
            string forcast = string.Empty;

            try
            {
                if (fI < wR.WeatherRate1)
                {
                    forcast = wR.Weather1;
                }
                else if (fI < wR.WeatherRate2)
                {
                    forcast = wR.Weather2;
                }
                else if (fI < wR.WeatherRate3)
                {
                    forcast = wR.Weather3;
                }
                else if (fI < wR.WeatherRate4)
                {
                    forcast = wR.Weather4;
                }
                else if (fI < wR.WeatherRate5)
                {
                    forcast = wR.Weather5;
                }
                else if (fI < wR.WeatherRate6)
                {
                    forcast = wR.Weather6;
                }
                else if (fI < wR.WeatherRate7)
                {
                    forcast = wR.Weather7;
                }
                else if (fI < wR.WeatherRate8)
                {
                    forcast = wR.Weather8;
                }
                else
                {
                    forcast = "None found";
                }
            }
            catch (Exception e)
            {
                forcast = $"Null due to {e.Message}";
            }
            return(forcast);
        }
Exemplo n.º 3
0
 public Territory(string placeName, int weatherRateIndex)
 {
     PlaceName       = placeName;
     ThisWeatherRate = WeatherRate.weatherRate.FirstOrDefault(w => w.Key == weatherRateIndex).Value;
 }