private async Task Generate(VersionGenerator generator) { activity = $"Generating " + generator.VersionTypeName; max = _metadataStore.CountFilesMissingAttributeVersion(generator.VersionTypeName); var files = _metadataStore.FilesMissingAttributeVersion(generator.VersionTypeName); processed = 0; foreach (var file in files) { try { Stream content = _metadataStore.GetFileStream(file.Id); var thumbnailValue = generator.GenerateVersion(content); await _metadataStore.AddVersion(file.Id, generator.VersionTypeName, thumbnailValue); processed++; } catch (Exception ex) { } } }
private void LvPhotos_SelectionChanged(object sender, SelectionChangedEventArgs e) { var thumbnail = lvPhotos.SelectedItem as Thumbnail; if (thumbnail != null) { var stream = _metadataStore.GetFileStream(thumbnail.Fileid); var image = BitmapFrame.Create(stream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad); imgPreview.Source = image; border.Reset(); txtMetadata.Text = string.Join("\r\n\r\n", _metadataStore.GetMetadata(thumbnail.Fileid)); } }