Beispiel #1
0
        public override void Deplace(Temps maintenant, ref Rectangle tailleEcran)
        {
#if TRACER
            RenderStart(CHRONO_TYPE.DEPLACE);
#endif
            if (_infos.MustRefresh(maintenant))
            {
                _infos = new MeteoInfo(METEO_URL);
            }

            if (_droite)
            {
                _X = tailleEcran.Width - _taille.Width;
            }
            else
            {
                _X = 0;
            }

            _Y = tailleEcran.Top + (tailleEcran.Height - _taille.Height) / 2;

            if (_droite)
            {
                tailleEcran = new Rectangle((int)tailleEcran.X, (int)tailleEcran.Y, (int)_X, (int)tailleEcran.Height);
            }
            else
            {
                tailleEcran = new Rectangle((int)_taille.Width, (int)tailleEcran.Y, (int)(tailleEcran.Width - _taille.Width), (int)tailleEcran.Height);
            }

#if TRACER
            RenderStop(CHRONO_TYPE.DEPLACE);
#endif
        }
Beispiel #2
0
 /// <summary>
 /// Constructeur
 /// </summary>
 public Meteo()
 {
     if (r.Next(0, 2) > 0)
     {
         _droite = true;
     }
     else
     {
         _droite = false;
     }
     _taille = new SizeF(100, 0);
     _infos  = new MeteoInfo(METEO_URL);
 }