C# Class Bloom.Edit.ToolboxView

This class supports the Edit Tab Toolbox as a whole. Eventually, all of this should be moved to javascript-land. Since the toolbox is mainly implemented in HTML/Javascript, there is no distinct .NET control for it. Thus, unlike other View classes in Bloom, ToolboxView does not inherit from a Control class, nor are there ever any instances; all methods are currently static.
Show file Open project: BloomBooks/BloomDesktop

Public Methods

Method Description
AppendAllChildren ( XmlNode source, XmlNode dest ) : void
AppendToolboxPanel ( HtmlDom domForToolbox, string fileName ) : void

Loads the requested panel into the toolbox

GetToolboxServerDirectories ( ) : IEnumerable
LoadPanelIntoToolbox ( HtmlDom domForToolbox, ToolboxTool tool, List checkedBoxes, string toolboxFolder ) : void
MakeToolboxContent ( Book book ) : string
RegisterWithServer ( EnhancedImageServer server ) : void
SaveToolboxSettings ( Book book, string data ) : void

Used to save various settings relating to the toolbox. Passed a string which is typically two or three elements divided by a tab. - may be passed 'active' followed by the ID of one of the check boxes that indicates whether the DR, LR, or TB tools are in use, followed by "1" if it is used, or "0" if not. These IDs are arranged to be the tool name followed by "Check". - may be passed 'current' followed by the name of one of the toolbox tools - may be passed 'state' followed by the name of one of the tools and its current state string.

SetupToolboxForCollection ( CollectionSettings settings ) : void

Provides a hook for anything the toolbox wants to do when a project is opened.

Private Methods

Method Description
AddToolDependencies ( HtmlDom toolDom ) : void
CopyToolSettingsForBloomPack ( string newlyAddedFolderOfThePack ) : void

Some tool settings files may need moving to the correct locations when installing a bloompack. Currently only the reader tools needs to do this. We could try to do some trick where we call a method on all subclasses by reflection, but I think this is sufficient encapsulation.

GetToolsToDisplay ( Book book, string idsOfToolsThisVersionKnowsAbout ) : List
HandleSettings ( ApiRequest request ) : void
UpdateActiveToolSetting ( Book book, string toolName, bool enabled ) : void
UpdateToolState ( Book book, string toolName, string state ) : void
UpdateToolboxVisibility ( Book book, string visibility ) : void

Method Details

AppendAllChildren() public static method

public static AppendAllChildren ( XmlNode source, XmlNode dest ) : void
source System.Xml.XmlNode
dest System.Xml.XmlNode
return void

AppendToolboxPanel() public static method

Loads the requested panel into the toolbox
public static AppendToolboxPanel ( HtmlDom domForToolbox, string fileName ) : void
domForToolbox Bloom.Book.HtmlDom
fileName string
return void

GetToolboxServerDirectories() public static method

public static GetToolboxServerDirectories ( ) : IEnumerable
return IEnumerable

LoadPanelIntoToolbox() public static method

public static LoadPanelIntoToolbox ( HtmlDom domForToolbox, ToolboxTool tool, List checkedBoxes, string toolboxFolder ) : void
domForToolbox Bloom.Book.HtmlDom
tool ToolboxTool
checkedBoxes List
toolboxFolder string
return void

MakeToolboxContent() public static method

public static MakeToolboxContent ( Book book ) : string
book Bloom.Book.Book
return string

RegisterWithServer() public static method

public static RegisterWithServer ( EnhancedImageServer server ) : void
server Bloom.Api.EnhancedImageServer
return void

SaveToolboxSettings() public static method

Used to save various settings relating to the toolbox. Passed a string which is typically two or three elements divided by a tab. - may be passed 'active' followed by the ID of one of the check boxes that indicates whether the DR, LR, or TB tools are in use, followed by "1" if it is used, or "0" if not. These IDs are arranged to be the tool name followed by "Check". - may be passed 'current' followed by the name of one of the toolbox tools - may be passed 'state' followed by the name of one of the tools and its current state string.
public static SaveToolboxSettings ( Book book, string data ) : void
book Bloom.Book.Book
data string
return void

SetupToolboxForCollection() public static method

Provides a hook for anything the toolbox wants to do when a project is opened.
public static SetupToolboxForCollection ( CollectionSettings settings ) : void
settings Bloom.Collection.CollectionSettings
return void