Пример #1
0
 public TripStore(PhotoStore photoStore, LocationService locationService, TripSmartBuilder smartBuilder, TripsRepo tripRepo)
 {
     _photoStore      = photoStore;
     _locationService = locationService;
     _smartBuilder    = smartBuilder;
     _tripRepo        = tripRepo;
 }
Пример #2
0
        private void Load(FileMode mode = FileMode.OpenOrCreate)
        {
            using (var fileStream = File.Open(_fileName, mode))
            {
                var newRepo = TripsRepo.CreateFromStream(fileStream);

                if (_tripsRepo != null && newRepo.LastModification != _tripsRepo?.LastModification)
                {
                    // keep old repo
                    _previousRepo = _tripsRepo;
                }

                _tripsRepo = newRepo;
            }
        }