C# Class Bloom.HtmlThumbNailer

Inheritance: IDisposable
Show file Open project: BloomBooks/BloomDesktop Class Usage Examples

Private Properties

Property Type Description
Advance void
CreateImage Image
CreateThumbNail bool
GetBrowserForPaperSize Gecko.GeckoWebBrowser
GetPaperSizeName string
MakeNewBrowser Gecko.GeckoWebBrowser
MakeThumbNail Image
OpenTempFileInBrowser bool
ProcessOrder void
QueueOrder void
SetWidthAndHeight System.Drawing.Size
_browser_OnDocumentCompleted void

Public Methods

Method Description
Dispose ( ) : void
GetThumbnail ( string key, HtmlDom document, ThumbnailOptions options ) : Image

A synchronous version of getting thumbnails, currently used by the image server to get thumbnails that are used in the add page dialog.

GetThumbnail ( string folderForThumbNailCache, string key, HtmlDom document, ThumbnailOptions options, Action callback, Action errorCallback, bool async ) : void

GetThumbnailAsync ( string folderForThumbNailCache, string key, HtmlDom document, ThumbnailOptions options, Action callback, Action errorCallback ) : void

HtmlThumbNailer ( NavigationIsolator isolator ) : System
PageChanged ( string id ) : void

How this page looks has changed, so remove from our cache

RemoveFromCache ( string key ) : void

Private Methods

Method Description
Advance ( Control invokeTarget ) : void

This is a trick that processes waiting for thumbnails can use in situations where Application.Idle is not being invoked. Such uses must pass a non-null control created in the thread where Application_Idle should be invoked (i.e., the UI thread)

CreateImage ( Gecko.GeckoWebBrowser browser ) : Image
CreateThumbNail ( ThumbnailOrder order, Gecko.GeckoWebBrowser browser, Image &thumbnail ) : bool

Returns true if it make some attempt at an image, false if navigation is currently suppressed.

GetBrowserForPaperSize ( XmlDocument document ) : Gecko.GeckoWebBrowser
GetPaperSizeName ( XmlDocument document ) : string
MakeNewBrowser ( ) : Gecko.GeckoWebBrowser
MakeThumbNail ( Image bmp, ThumbnailOptions options ) : Image
OpenTempFileInBrowser ( Gecko.GeckoWebBrowser browser, string filePath ) : bool
ProcessOrder ( object stateInfo ) : void
QueueOrder ( ThumbnailOrder order ) : void
SetWidthAndHeight ( Gecko.GeckoWebBrowser browser ) : Size
_browser_OnDocumentCompleted ( object sender, GeckoDocumentCompletedEventArgs geckoDocumentCompletedEventArgs ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

GetThumbnail() public method

A synchronous version of getting thumbnails, currently used by the image server to get thumbnails that are used in the add page dialog.
public GetThumbnail ( string key, HtmlDom document, ThumbnailOptions options ) : Image
key string Used to retrieve the thumbnail from a dictionary if we are asked for /// the same one repeatedly
document Bloom.Book.HtmlDom Whose rendering will produce the thumbnail content.
options ThumbnailOptions
return Image

GetThumbnail() public method

public GetThumbnail ( string folderForThumbNailCache, string key, HtmlDom document, ThumbnailOptions options, Action callback, Action errorCallback, bool async ) : void
folderForThumbNailCache string
key string whatever system you want... just used for caching
document Bloom.Book.HtmlDom
options ThumbnailOptions
callback Action
errorCallback Action
async bool
return void

GetThumbnailAsync() public method

public GetThumbnailAsync ( string folderForThumbNailCache, string key, HtmlDom document, ThumbnailOptions options, Action callback, Action errorCallback ) : void
folderForThumbNailCache string
key string whatever system you want... just used for caching
document Bloom.Book.HtmlDom
options ThumbnailOptions
callback Action
errorCallback Action
return void

HtmlThumbNailer() public method

public HtmlThumbNailer ( NavigationIsolator isolator ) : System
isolator NavigationIsolator
return System

PageChanged() public method

How this page looks has changed, so remove from our cache
public PageChanged ( string id ) : void
id string
return void

RemoveFromCache() public method

public RemoveFromCache ( string key ) : void
key string
return void