Пример #1
0
 private void ReadOverview(string overviewFilePath)
 {
     using (var fileReader = new StreamReader(overviewFilePath, Encoding.Unicode))
         using (var jsonReader = new JsonTextReader(fileReader))
         {
             var jsonSerializer = new JsonSerializer();
             _overview = jsonSerializer.Deserialize <AlbumOverview>(jsonReader);
         }
 }
Пример #2
0
        public AlbumCreator(IPhotosDbContext context, AlbumOverview photosOverview, PlaceRegister placeRegister, IEnumerable <IPhotoImage> photoImages)
        {
            Verifiers.ArgNullVerify(photosOverview, nameof(photosOverview));

            _context        = context;
            _photosOverview = photosOverview;
            _place          = placeRegister.Register(_photosOverview.Place, _photosOverview.City, _photosOverview.Country);
            _photoImages    = photoImages;
        }
Пример #3
0
        private void CreatePhotoAlbum(AlbumOverview overview)
        {
            IEnumerable <IPhotoImage> photoImages = FindPhotoImages(_rootDirectory);

            if (photoImages.Any())
            {
                var photoAlbumCreator = new AlbumCreator(_context, overview, _placeRegister, photoImages);
                photoAlbumCreator.CreatePhotoAlbum();
            }
        }
Пример #4
0
        public bool ReadOverview()
        {
            string overviewFilePath = Path.Combine(_directory, OverviewFileName);

            if (File.Exists(overviewFilePath))
            {
                ReadOverview(overviewFilePath);
                return(true);
            }

            _overview = GenerateDefaultOverview();
            return(true);
        }