C# Class Bloom.Book.XMatterHelper

Handles chores related to Front and Back Matter packs. These allow users to have a set which fits there country/organizational situation, and have it applied to all books they create, whether original or from shells created in other country/organization contexts.
Show file Open project: BloomBooks/BloomDesktop Class Usage Examples

Public Methods

Method Description
GetStyleSheetFileName ( ) : string
InjectXMatter ( string>.Dictionary writingSystemCodes, Layout layout ) : void
IsBackMatterPage ( XmlElement pageDiv ) : bool
IsFrontMatterPage ( XmlElement pageDiv ) : bool
RemoveExistingXMatter ( HtmlDom dom ) : void

remove any x-matter in the book

XMatterHelper ( HtmlDom bookDom, string nameOfXMatterPack, IFileLocator fileLocator ) : System

Constructs by finding the file and folder of the xmatter pack, given the its key name e.g. "Factory", "SILIndonesia". The name of the file should be (key)-XMatter.htm. The name and the location of the folder is not our problem... we leave it to the supplied fileLocator to find it.

Private Methods

Method Description
InjectFlyleafIfNeeded ( Layout layout ) : void

Some book layouts rely on the first page facing the second page. A Wall Calendar is one example. Here we check if the first content page has this requirement and, if so, we insert a blank "flyleaf" page.

Method Details

GetStyleSheetFileName() public method

public GetStyleSheetFileName ( ) : string
return string

InjectXMatter() public method

public InjectXMatter ( string>.Dictionary writingSystemCodes, Layout layout ) : void
writingSystemCodes string>.Dictionary
layout Layout
return void

IsBackMatterPage() public static method

public static IsBackMatterPage ( XmlElement pageDiv ) : bool
pageDiv System.Xml.XmlElement
return bool

IsFrontMatterPage() public static method

public static IsFrontMatterPage ( XmlElement pageDiv ) : bool
pageDiv System.Xml.XmlElement
return bool

RemoveExistingXMatter() public static method

remove any x-matter in the book
public static RemoveExistingXMatter ( HtmlDom dom ) : void
dom HtmlDom
return void

XMatterHelper() public method

Constructs by finding the file and folder of the xmatter pack, given the its key name e.g. "Factory", "SILIndonesia". The name of the file should be (key)-XMatter.htm. The name and the location of the folder is not our problem... we leave it to the supplied fileLocator to find it.
public XMatterHelper ( HtmlDom bookDom, string nameOfXMatterPack, IFileLocator fileLocator ) : System
bookDom HtmlDom
nameOfXMatterPack string e.g. "Factory", "SILIndonesia"
fileLocator IFileLocator The locator needs to be able tell us the path to an xmater html file, given its name
return System