C# Class Bloom.BookThumbNailer

This class is a place to gather the methods that have to do with making thumbnails of pages of books. Three of the methods were previously methods of Book itself, but the fourth (MakeThumbnailOfCover) needed to do too much UI stuff to belong in a model class, so it seemed worth pulling all this out to a new class. In live code there is typically only one instance of this created by the ApplicationServer. In test code they may be created as needed; nothing requires this to be a singleton. Indeed, it could be a static class except that it requires the HtmlThumbNailer.
Afficher le fichier Open project: BloomBooks/BloomDesktop Class Usage Examples

Méthodes publiques

Méthode Description
BookThumbNailer ( HtmlThumbNailer thumbNailer ) : System
GetThumbNailOfBookCover ( Book book, HtmlThumbNailer thumbnailOptions, Action callback, Action errorCallback, bool async ) : void
GetThumbnailForPage ( Book book, IPage page, bool isLandscape ) : Image

Currently used by the image server to get thumbnails that are used in the add page dialog. Since this dialog can show an enlarged version of the page, we generate these at a higher resolution than usual. Also, to make more realistic views of template pages we insert fake text wherever there is an empty edit block. The result is cached for possible future use so the caller should not dispose of it.

MakeThumbnailOfCover ( Book book, Control invokeTarget ) : void
MakeThumbnailOfCover ( Book book, int height, Control invokeTarget ) : void
RebuildThumbNailAsync ( Book book, HtmlThumbNailer thumbnailOptions, Image>.Action callback, Exception>.Action errorCallback ) : void

Will call either 'callback' or 'errorCallback' UNLESS the thumbnail is readonly, in which case it will do neither.

RebuildThumbNailNow ( Book book, HtmlThumbNailer thumbnailOptions ) : void

Will make a new thumbnail (or throw) UNLESS the thumbnail is readonly, in which case it will do nothing.

Private Methods

Méthode Description
RebuildThumbNail ( Book book, HtmlThumbNailer thumbnailOptions, Image>.Action callback, Exception>.Action errorCallback, bool async ) : void

Will call either 'callback' or 'errorCallback' UNLESS the thumbnail is readonly, in which case it will do neither.

Method Details

BookThumbNailer() public méthode

public BookThumbNailer ( HtmlThumbNailer thumbNailer ) : System
thumbNailer HtmlThumbNailer
Résultat System

GetThumbNailOfBookCover() public méthode

public GetThumbNailOfBookCover ( Book book, HtmlThumbNailer thumbnailOptions, Action callback, Action errorCallback, bool async ) : void
book Bloom.Book.Book
thumbnailOptions HtmlThumbNailer
callback Action
errorCallback Action
async bool
Résultat void

GetThumbnailForPage() public méthode

Currently used by the image server to get thumbnails that are used in the add page dialog. Since this dialog can show an enlarged version of the page, we generate these at a higher resolution than usual. Also, to make more realistic views of template pages we insert fake text wherever there is an empty edit block. The result is cached for possible future use so the caller should not dispose of it.
public GetThumbnailForPage ( Book book, IPage page, bool isLandscape ) : Image
book Bloom.Book.Book
page IPage
isLandscape bool
Résultat Image

MakeThumbnailOfCover() public méthode

public MakeThumbnailOfCover ( Book book, Control invokeTarget ) : void
book Bloom.Book.Book
invokeTarget System.Windows.Forms.Control
Résultat void

MakeThumbnailOfCover() public méthode

public MakeThumbnailOfCover ( Book book, int height, Control invokeTarget ) : void
book Bloom.Book.Book
height int
invokeTarget System.Windows.Forms.Control
Résultat void

RebuildThumbNailAsync() public méthode

Will call either 'callback' or 'errorCallback' UNLESS the thumbnail is readonly, in which case it will do neither.
public RebuildThumbNailAsync ( Book book, HtmlThumbNailer thumbnailOptions, Image>.Action callback, Exception>.Action errorCallback ) : void
book Bloom.Book.Book
thumbnailOptions HtmlThumbNailer
callback Image>.Action
errorCallback Exception>.Action
Résultat void

RebuildThumbNailNow() public méthode

Will make a new thumbnail (or throw) UNLESS the thumbnail is readonly, in which case it will do nothing.
public RebuildThumbNailNow ( Book book, HtmlThumbNailer thumbnailOptions ) : void
book Bloom.Book.Book
thumbnailOptions HtmlThumbNailer
Résultat void