Beispiel #1
0
        private void updateScreen()
        {
            WeatherResponse weatherResponse = this.weatherResponse = (WeatherResponse)g_Weather.Invoke();
            ISharedResponse sharedResponse  = g_SunRiseSet.Invoke();
            string          text            = SharedObjects.BetweenTimespans(DateTime.Now.TimeOfDay, ((SunRiseSetResponse)sharedResponse).SunRise.TimeOfDay, ((SunRiseSetResponse)sharedResponse).SunSet.TimeOfDay) ? "Day" : "Night";
            string          name            = Enum.GetName(typeof(SharedObjects.WeatherTypes), weatherResponse.WType);

            trayIcon.Tooltip = ($"{name} {weatherResponse.Temp}");
            _ = text + name;
            trayIcon.Pixbuf = ((Pixbuf)(object)new Pixbuf(GetWeatherIconPath(weatherResponse.WType, text == "Day")));
        }
Beispiel #2
0
        private void updateScreen()
        {
            //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ce: Expected O, but got Unknown
            WeatherResponse weatherResponse = this.weatherResponse = (WeatherResponse)g_Weather.Invoke();
            ISharedResponse sharedResponse  = g_SunRiseSet.Invoke();
            string          text            = SharedObjects.BetweenTimespans(DateTime.Now.TimeOfDay, ((SunRiseSetResponse)sharedResponse).SunRise.TimeOfDay, ((SunRiseSetResponse)sharedResponse).SunSet.TimeOfDay) ? "Day" : "Night";
            string          name            = Enum.GetName(typeof(SharedObjects.WeatherTypes), weatherResponse.WType);

            trayIcon.set_Tooltip($"{name} {weatherResponse.Temp}");
            _ = text + name;
            trayIcon.set_Pixbuf((Pixbuf)(object)new Pixbuf(GetWeatherIconPath(weatherResponse.WType, text == "Day")));
        }
Beispiel #3
0
        private void UpdateScreen()
        {
            var    weather    = (WeatherResponse)g_Weather.Invoke();
            var    sunriseSet = g_SunRiseSet.Invoke();
            string currentTime;

            currentTime = (SharedObjects.BetweenTimespans(DateTime.Now.TimeOfDay, ((SunRiseSetResponse)sunriseSet).SunRise.TimeOfDay, ((SunRiseSetResponse)sunriseSet).SunSet.TimeOfDay)) ? Properties.Resources.cDay : Properties.Resources.cNight;
            string weatherType = Enum.GetName(typeof(SharedObjects.WeatherTypes), weather.WType);

            notifyIcon.Text = weatherType + " " + weather.Temp.ToString();
            string currentWeatherType = currentTime + weatherType;

            if (string.IsNullOrWhiteSpace(g_CurrentWeatherType) || currentWeatherType != g_CurrentWeatherType)
            {
                g_CurrentWeatherType = currentWeatherType;
                notifyIcon.Icon      = GetWeatherIcon(weather.WType, (currentTime == Properties.Resources.cDay));
            }
        }