C# Class Bloom.Collection.CollectionSettings

A library corresponds to a single folder (with subfolders) on the disk. In that folder is a file which persists the properties of this class, then a folder for each book
Show file Open project: BloomBooks/BloomDesktop Class Usage Examples

Public Properties

Property Type Description
PageNumberStyleKeys string[]

Private Properties

Property Type Description
AddFontCssRule void
AddNumberingStyleCssRule void
DoOneTimeCheck void
GetBoolValue bool
GetDecimalValue decimal
GetDefaultFontName string
GetIntegerValue int
GetLanguage1Name_NoCache string
GetLanguageNameInUILangIfPossible string
GetValue string
MakeLanguageUploadData Bloom.Book.LanguageDescriptor[]
MigrateSettingsToAndikaNewBasicFont bool
SaveSettingsCollectionStylesCss void

Public Methods

Method Description
CollectionSettings ( ) : System

for moq in unit tests only

CollectionSettings ( NewCollectionSettings collectionInfo ) : System
CollectionSettings ( string desiredOrExistingSettingsFilePath ) : System

can be used whether the library exists already, or not

CreateNewCollection ( NewCollectionSettings collectionInfo ) : void
FindSettingsFileInFolder ( string folderPath ) : string
GetLanguage1Name ( string inLanguage ) : string
GetLanguage2Name ( string inLanguage ) : string
GetLanguage3Name ( string inLanguage ) : string
GetLanguageLineHeight ( int langNum ) : decimal
GetLanguageName ( string code, string inLanguage ) : string

Get the name of the language whose code is the first argument, if possible in the language specified by the second. If the language code is unknown, return it unchanged.

GetLanguageRtl ( int langNum ) : bool
GetPathForNewSettings ( string parentFolderPath, string newCollectionName ) : string
Load ( ) : void
RenameCollection ( string fromDirectory, string toDirectory ) : string
Save ( ) : void
SetLanguageLineHeight ( int langNum, decimal lineHeight ) : void
SetLanguageRtl ( int langNum, bool isRtl ) : void

Private Methods

Method Description
AddFontCssRule ( StringBuilder sb, string selector, string fontName, decimal lineHeight ) : void
AddNumberingStyleCssRule ( StringBuilder sb, string styleNameKey ) : void
DoOneTimeCheck ( ) : void
GetBoolValue ( System.Xml.Linq.XElement library, string id, bool defaultValue ) : bool
GetDecimalValue ( System.Xml.Linq.XElement library, string id, decimal defaultValue ) : decimal
GetDefaultFontName ( ) : string
GetIntegerValue ( System.Xml.Linq.XElement library, string id, int defaultValue ) : int
GetLanguage1Name_NoCache ( string inLanguage ) : string
GetLanguageNameInUILangIfPossible ( string name, string codeOfDesiredLanguage ) : string
GetValue ( System.Xml.Linq.XElement document, string id, string defaultValue ) : string
MakeLanguageUploadData ( string isoCodes ) : Bloom.Book.LanguageDescriptor[]
MigrateSettingsToAndikaNewBasicFont ( ) : bool
SaveSettingsCollectionStylesCss ( ) : void

Method Details

CollectionSettings() public method

for moq in unit tests only
public CollectionSettings ( ) : System
return System

CollectionSettings() public method

public CollectionSettings ( NewCollectionSettings collectionInfo ) : System
collectionInfo NewCollectionSettings
return System

CollectionSettings() public method

can be used whether the library exists already, or not
public CollectionSettings ( string desiredOrExistingSettingsFilePath ) : System
desiredOrExistingSettingsFilePath string
return System

CreateNewCollection() public static method

public static CreateNewCollection ( NewCollectionSettings collectionInfo ) : void
collectionInfo NewCollectionSettings
return void

FindSettingsFileInFolder() public static method

public static FindSettingsFileInFolder ( string folderPath ) : string
folderPath string
return string

GetLanguage1Name() public method

public GetLanguage1Name ( string inLanguage ) : string
inLanguage string
return string

GetLanguage2Name() public method

public GetLanguage2Name ( string inLanguage ) : string
inLanguage string
return string

GetLanguage3Name() public method

public GetLanguage3Name ( string inLanguage ) : string
inLanguage string
return string

GetLanguageLineHeight() public method

public GetLanguageLineHeight ( int langNum ) : decimal
langNum int
return decimal

GetLanguageName() public method

Get the name of the language whose code is the first argument, if possible in the language specified by the second. If the language code is unknown, return it unchanged.
public GetLanguageName ( string code, string inLanguage ) : string
code string
inLanguage string
return string

GetLanguageRtl() public method

public GetLanguageRtl ( int langNum ) : bool
langNum int
return bool

GetPathForNewSettings() public static method

public static GetPathForNewSettings ( string parentFolderPath, string newCollectionName ) : string
parentFolderPath string
newCollectionName string
return string

Load() public method

public Load ( ) : void
return void

RenameCollection() public static method

public static RenameCollection ( string fromDirectory, string toDirectory ) : string
fromDirectory string
toDirectory string
return string

Save() public method

public Save ( ) : void
return void

SetLanguageLineHeight() public method

public SetLanguageLineHeight ( int langNum, decimal lineHeight ) : void
langNum int
lineHeight decimal
return void

SetLanguageRtl() public method

public SetLanguageRtl ( int langNum, bool isRtl ) : void
langNum int
isRtl bool
return void

Property Details

PageNumberStyleKeys public static property

public static string[] PageNumberStyleKeys
return string[]