コード例 #1
0
ファイル: WeatherDocklet.cs プロジェクト: crystaldust/Docky
        /// <summary>
        /// Handles when a weather source successfully reloads data.
        /// </summary>
        void HandleWeatherUpdated()
        {
            DockServices.System.RunOnMainThread(delegate {
                AbstractWeatherSource weather = WeatherController.Weather;

                string feelsLike = "";
                if (weather.ShowFeelsLike)
                {
                    feelsLike = " (" + weather.FeelsLike + AbstractWeatherSource.TempUnit + ")";
                }

                HoverText = weather.Condition + "   " +
                            weather.Temp + AbstractWeatherSource.TempUnit + feelsLike +
                            "   " + weather.City;
                Icon   = WeatherController.Weather.Image;
                Status = WeatherDockletStatus.Normal;
                State &= ~ItemState.Wait;

                QueueRedraw();

                if (painter != null)
                {
                    painter.WeatherChanged();
                }
            });
        }
コード例 #2
0
        /// <summary>
        /// Returns the singleton instance for this class.
        /// </summary>
        /// <returns>
        /// A <see cref="AbstractWeatherSource"/> that is the only instance of this class.
        /// </returns>
        public static AbstractWeatherSource GetInstance()
        {
            if (Instance == null)
            {
                Instance = new WeatherChannelWeatherSource();
            }

            return(Instance);
        }
コード例 #3
0
        /// <summary>
        /// Returns the singleton instance for this class.
        /// </summary>
        /// <returns>
        /// A <see cref="AbstractWeatherSource"/> that is the only instance of this class.
        /// </returns>
        public static AbstractWeatherSource GetInstance()
        {
            if (Instance == null)
            {
                Instance = new GoogleWeatherSource();
            }

            return(Instance);
        }
コード例 #4
0
		/// <summary>
		/// Returns the singleton instance for this class.
		/// </summary>
		/// <returns>
		/// A <see cref="AbstractWeatherSource"/> that is the only instance of this class.
		/// </returns>
		public static AbstractWeatherSource GetInstance ()
		{
			if (Instance == null)
				Instance = new WunderWeatherSource ();
			
			return Instance;
		}