private void LoadTimetable(Timetable timetable)
        {
            UIApplication.SharedApplication.InvokeOnMainThread(() =>
            {
                _pageScrollController.Clear();
                if (timetable.BlockedTimetable)
                {
                    var root = new RootElement("Blockiert"){
                        new Section("Blockiert"){
                            new MultilineElement("Benutzer hat Stundenplan\nblockiert")
                        }
                    };
                    var dvc = new DefaultDialogViewController(root, UITableViewStyle.Plain, RefreshRequested);
                    dvc.CustomLastUpdate = timetable.LastUpdated;
                    _pageScrollController.AddPage(dvc);
                }
                else if (timetable.HasError)
                {
                    var root = new RootElement("Error"){
                        new Section("Error"){
                            new MultilineElement(timetable.ErrorMessage)
                        }
                    };
                    var dvc = new DefaultDialogViewController(root, UITableViewStyle.Plain, RefreshRequested);
                    dvc.CustomLastUpdate = timetable.LastUpdated;
                    _pageScrollController.AddPage(dvc);
                }
                else
                {
                    foreach (var day in timetable.TimetableDays)
                    {
                        if (day.Lessions.Count() == 0)
                            continue;
                        var root = new RootElement((string.IsNullOrEmpty(day.Weekday) ? "Ohne Wochentag" : day.Weekday));
                        foreach (var lession in day.Lessions)
                        {
                            var section = new Section(lession.Name + " " + lession.Type);
                            foreach (var alloc in lession.CourseAllocations)
                            {
                                string t = alloc.Timeslot;
                                if (alloc.RoomAllocations.Count() > 0)
                                    t += "\n" + alloc.RoomAllocations.FirstOrDefault().Roomnumber;
                                var tmpLession = new Lession(){CourseAllocations=lession.CourseAllocations,
                                                               Lecturers=lession.Lecturers,
                                                               Name=lession.Name,
                                                               Type=lession.Type};
                                section.Add(new MultilineElement(t, () => {

                                    OnElementTappet(tmpLession);}){Value=lession.LecturersShortVersion});
                            }
                            root.Add(section);
                        }
                        var dvc = new DefaultDialogViewController(root, UITableViewStyle.Plain, RefreshRequested);
                        dvc.CustomLastUpdate = timetable.LastUpdated;
                        _pageScrollController.AddPage(dvc);
                    }
                }
            });
            _loadedTimetable = timetable;
        }
 private void displayTimetable(Timetable timetable)
 {
     this.RunOnUiThread(() => horiPager.RemoveAllViews());
     if (timetable != null && timetable.TimetableDays.Count > 0)
     {
         int i = 0;
         int day_value = (int)System.DateTime.Today.DayOfWeek;
         if (day_value == 0) day_value = 7;
         foreach (TimetableDay day in timetable.TimetableDays)
         {
             this.RunOnUiThread(() => horiPager.AddView(new TimetableDayView(day, i > 0, i < timetable.TimetableDays.Count - 1).GetView(this)));
             i++;
         }
         this.RunOnUiThread(() => horiPager.SetCurrentScreen(day_value, false));
     }
     else
     {
         TextView test = new TextView(this);
         if (timetable.ErrorMessage != null)
             test.Text = timetable.ErrorMessage;
         else
             test.Text = "Keine Daten gefunden";
         this.RunOnUiThread(() => horiPager.AddView(test));
     }
 }
 private void TimetableCallback(Timetable timetable, object[] args)
 {
     if (!timetable.Equals(_loadedTimetable))
     {
         if (!string.IsNullOrEmpty(timetable.Username))
             ApplicationSettings.Instance.Persistency.Save(timetable);
         LoadTimetable(timetable);
     }
     else
     {
         UIApplication.SharedApplication.InvokeOnMainThread(() => {
             foreach (var o in _pageScrollController)
             {
                 o.ReloadComplete();
             }
         });
     }
 }
 private void TimetableCallback(Timetable timetable, object[] callbackArguments)
 {
     displayTimetable(timetable);
     ApplicationSettings.Instance.Persistency.Save(timetable);
 }