Exemplo n.º 1
0
        private void Dispatcher_Elapsed(object sender, object e)
        {
            //Correctly update layout on start
            if (counter == 0)
            {
                UpdateUiContent();
                UpdateUiContent();
            }
            //Update clock
            UpdateAnalogueClock();
            TBlockTime.Text = CalendarHandler.GetStringDate("HH:mm:ss");

            if (counter % 20 == 0) //20 seconds
            {
                WeatherAndComicToggle();

                //News
                if (counter % 30 == 0) //30 seconds
                {
                    if (rSSFeedHandler.NewsList.Count > 0)
                    {
                        SetNews();
                        NewsTextFormatting();
                    }
                    else //If empty
                    {
                        rSSFeedHandler.GetFeed();
                    }
                }
            }
            //Time between global update : 5 min.
            if (counter >= 300)
            {
                //Update static model for all handlers
                dbHandler.UpdateModel();

                //Update User Interface
                UpdateUiContent();

                //Update IP
                //UpdateIp();

                counter = 1;
            }
            else
            {
                counter++;
            }
        }
Exemplo n.º 2
0
 public MainPage()
 {
     this.InitializeComponent();
     lunchPlanHandler = new LunchPlanHandler();
     mealHandler      = new MealHandler();
     dbHandler        = new DBHandler();
     messageHandler   = new MessageHandler();
     imageHandler     = new ImageHandler();
     rSSFeedHandler   = new RSSFeedHandler("http://feeds.tv2.dk/nyhederne_seneste/rss");
     iPHandler        = new IPHandler();
     clockHandler     = new ClockHandler();
     Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Title = CalendarHandler.GetStringDate("dd/MM/yyyy") + " - Uge : " + CalendarHandler.GetWeekNumber();
     UpdateIp();
     counter = 0;
     SetDpTimer();
 }