Example #1
0
        private static string GetWeatherIconPath(SharedObjects.WeatherTypes weather, bool isDaytime)
        {
            switch (weather)
            {
            case SharedObjects.WeatherTypes.Clear:
                if (!isDaytime)
                {
                    return(iconPath + "Clear_night.png");
                }
                return(iconPath + "Clear_day.png");

            case SharedObjects.WeatherTypes.Cloudy:
                return(iconPath + "cloudy.png");

            case SharedObjects.WeatherTypes.Fog:
                return(iconPath + "fog.png");

            case SharedObjects.WeatherTypes.Frigid:
                return(iconPath + "Frigid.png");

            case SharedObjects.WeatherTypes.Hot:
                return(iconPath + "hot.png");

            case SharedObjects.WeatherTypes.PartlyCloudy:
                if (!isDaytime)
                {
                    return(iconPath + "PartlyCloudy_night.png");
                }
                return(iconPath + "PartlyCloudy_day.png");

            case SharedObjects.WeatherTypes.Rain:
                return(iconPath + "raindrop.png");

            case SharedObjects.WeatherTypes.Snow:
                return(iconPath + "snowflake.png");

            case SharedObjects.WeatherTypes.ThunderStorm:
                return(iconPath + "Thunderstorm.png");

            case SharedObjects.WeatherTypes.Windy:
                return(iconPath + "wind.png");

            default:
                return(iconPath + "windsock.png");
            }
        }
Example #2
0
        private static System.Drawing.Icon GetWeatherIcon(SharedObjects.WeatherTypes weather, bool isDaytime)
        {
            switch (weather)
            {
            case SharedObjects.WeatherTypes.Clear:
                return((isDaytime) ? Properties.Resources.Clear_day : Properties.Resources.Clear_night);

            case SharedObjects.WeatherTypes.Cloudy:
                return(Properties.Resources.cloudy);

            case SharedObjects.WeatherTypes.Fog:
                return(Properties.Resources.fog);

            case SharedObjects.WeatherTypes.Frigid:
                return(Properties.Resources.Frigid);

            case SharedObjects.WeatherTypes.Hot:
                return(Properties.Resources.hot);

            case SharedObjects.WeatherTypes.PartlyCloudy:
                return((isDaytime) ? Properties.Resources.PartlyCloudy_day : Properties.Resources.PartlyCloudy_night);

            case SharedObjects.WeatherTypes.Rain:
                return(Properties.Resources.raindrop);

            case SharedObjects.WeatherTypes.Snow:
                return(Properties.Resources.snowflake);

            case SharedObjects.WeatherTypes.ThunderStorm:
                return(Properties.Resources.Thunderstorm);

            case SharedObjects.WeatherTypes.Windy:
                return(Properties.Resources.wind);

            case SharedObjects.WeatherTypes.Dust:
            case SharedObjects.WeatherTypes.Haze:
            case SharedObjects.WeatherTypes.Smoke:
            default:
                return(Properties.Resources.windsock);
            }
        }
Example #3
0
 private void ChangeWeatherType(object sender, EventArgs e)
 {
     SetWeatherType = (WeatherDesktop.Share.SharedObjects.WeatherTypes)System.Enum.Parse(typeof(WeatherDesktop.Share.SharedObjects.WeatherTypes), ((MenuItem)sender).Text);
 }