C# Class Controller.HtmlBuilder

Class used to generate the web front-end homepage. Uses a combination of files hosted externally from the Netduino, some templating fragments, and snippets for each active plugin
Inheritance: IDisposable
Show file Open project: h07r0d/Netduino-Aquarium-Controller Class Usage Examples

Public Methods

Method Description
AddPlugin ( string _scriptName, PluginType _type ) : void

Add required js and html for a specific plugin to the index generator

Dispose ( ) : void
GenerateIndex ( ) : void

Write out the index.html file to be served

HtmlBuilder ( ) : System
HtmlBuilder ( bool _local ) : System

Constructor, initializes temp files and necessary paths.

When the HtmlBuilder is initialized, check for any temp files and remove them. This ensures that the index.htm file that is built doesn't have any errors from the previous runs

Private Methods

Method Description
WritePlugins ( FileStream &_index, PluginType _type ) : bool

Write out the html for all of the plugins from their respective fragments

Method Details

AddPlugin() public method

Add required js and html for a specific plugin to the index generator
public AddPlugin ( string _scriptName, PluginType _type ) : void
_scriptName string string containing the name of the plugins javascript files
_type PluginType class of plugin. Different classes require different placement in the homepage
return void

Dispose() public method

public Dispose ( ) : void
return void

GenerateIndex() public method

Write out the index.html file to be served
public GenerateIndex ( ) : void
return void

HtmlBuilder() public method

public HtmlBuilder ( ) : System
return System

HtmlBuilder() public method

Constructor, initializes temp files and necessary paths.
When the HtmlBuilder is initialized, check for any temp files and remove them. This ensures that the index.htm file that is built doesn't have any errors from the previous runs
public HtmlBuilder ( bool _local ) : System
_local bool Use local resources or web sourced?
return System