コード例 #1
0
        void UpdateBookmarkedVplan()
        {
            if (SchoolVplan.Value == null)
            {
                return;
            }

            List <Change> bookmarkedChanges = new List <Change>();

            foreach (Change change in SchoolVplan.Value.Changes)
            {
                var bookmark = GetSchoolClassBookmark(change.SchoolClass);
                if (bookmark != null && bookmark.Bookmarked)
                {
                    bookmarkedChanges.Add(change);
                }
            }

            var newVplan = new Vplan(SchoolVplan.Value.LastUpdate, bookmarkedChanges);

            if (!newVplan.Equals(MyVplan.Value))
            {
                MyVplan.Value = newVplan;
            }
        }
コード例 #2
0
        private void UpdateData(Vplan vplan)
        {
            if (vplan == null)
            {
                Dates.Value = new Collection <VplanDayViewModel>();
                return;
            }

            var dayViewModelBuilders = new Dictionary <string, VplanDayViewModelBuilder>();
            var lastUpdate           = vplan.LastUpdate.ToString("dd.MM.yy hh:mm");

            foreach (var item in vplan.Changes)
            {
                var date = item.Day.ToString("dd.MM.yy");
                VplanDayViewModelBuilder dayViewModelBuilder;
                if (dayViewModelBuilders.ContainsKey(date))
                {
                    dayViewModelBuilder = dayViewModelBuilders[date];
                }
                else
                {
                    dayViewModelBuilder = new VplanDayViewModelBuilder(
                        item.Day.ToString("dddd"),
                        date,
                        lastUpdate,
                        IsRefreshing,
                        LoadItemsCommand
                        );
                    dayViewModelBuilders[date] = dayViewModelBuilder;
                }
                dayViewModelBuilder.Items.Add(new ChangeViewModel(item));
            }

            var dayViewModels = new Collection <VplanDayViewModel>();

            foreach (VplanDayViewModelBuilder builder in dayViewModelBuilders.Values)
            {
                dayViewModels.Add(builder.Build());
            }
            Dates.Value = dayViewModels;
        }
コード例 #3
0
 public async Task PersistVplan(Vplan vplan)
 {
     await Persist(vplan, VplanFileName, VplanSempahore);
 }
コード例 #4
0
 public Task PersistVplan(Vplan vplan) => Task.CompletedTask;