protected override async Task <bool> ApplyInternal()
        {
            List <SavedEntity> updatedSavedEntities = new();
            var selectedEntities = await Serialisation.FromJsonFile <List <SavedEntityWithoutEntity> >(FilePath.SavedEntitiesList);

            var entities = await Serialisation.FromJsonFile <List <Entity> >(FilePath.SavedEntitiesList);

            for (int i = 0; i < entities.Count; i++)
            {
                updatedSavedEntities.Add(new(entities[i])
                {
                    IsSelected  = selectedEntities[i].IsSelected,
                    LastUpdated = selectedEntities[i].LastUpdated
                });
コード例 #2
0
        public static async Task <List <Local::TimetableInfo> > GetTimetableLocal(List <Local::Entity> entities)
        {
            List <Local::TimetableInfo> timetables = new();

            if (entities == null)
            {
                return(timetables);
            }
            foreach (var entity in entities)
            {
                Local::TimetableInfo?timetableInfo = await Serialisation.FromJsonFile <Local::TimetableInfo>(FilePath.SavedTimetable(entity.Type, entity.ID));

                if (timetableInfo == null)
                {
                    continue;
                }
                timetables.Add(timetableInfo);
            }
            return(timetables);
        }
        protected override async Task <bool> IsNeedsToBeAppliedInternal()
        {
            var entities = await Serialisation.FromJsonFile <List <Entity> >(FilePath.SavedEntitiesList);

            return(entities?.Any() == true && entities.First().ID > 0);
        }