Detailed Description

A global lookup of tag text to handler. TagHandlers are instanced globally and mapped to the tags they accept. When a tag is found, it is then instanced. One instance of a tag is created per element.

Static Public Member Functions

static void Setup ()
 Sets up the global lookup by searching for any classes which inherit from TagHandler. More...
 
static TagHandler Default ()
 Gets the default TagHandler. More...
 
static bool AddHandler (TagHandler handler)
 Adds a handler to the set. This is generally done automatically, but you can also add it manually if you wish. More...
 
static TagHandler GetHandler (string tag, string defaultTag)
 Attempts to find the tag with the given name. If it's not found, a default tag which is known to exist can be returned instead. The handler for the found tag is then instanced and the instance is returned. For example, tag "h1" with a default of "span". More...
 
static TagHandler GetHandler (string tag)
 Attempts to find the named tag, returning the global handler if it's found. More...
 

Static Public Attributes

static Dictionary< string,
TagHandler
Handlers
 The lookup itself. Matches tag text (e.g. "div") to the handler that will process it. More...
 

Member Function Documentation

static bool Wrench.TagHandlers.AddHandler ( TagHandler  handler)
inlinestatic

Adds a handler to the set. This is generally done automatically, but you can also add it manually if you wish.

Parameters
handlerThe handler to add.
Returns
True if adding it was successful.
static TagHandler Wrench.TagHandlers.Default ( )
inlinestatic

Gets the default TagHandler.

static TagHandler Wrench.TagHandlers.GetHandler ( string  tag,
string  defaultTag 
)
inlinestatic

Attempts to find the tag with the given name. If it's not found, a default tag which is known to exist can be returned instead. The handler for the found tag is then instanced and the instance is returned. For example, tag "h1" with a default of "span".

Parameters
tagThe tag to look for.
defaultTagIf the given tag is not found, this is used instead.
Returns
An instance of the tag handler for the tag. Throws an error if tag or defaultTag are not found.
static TagHandler Wrench.TagHandlers.GetHandler ( string  tag)
inlinestatic

Attempts to find the named tag, returning the global handler if it's found.

Parameters
tagThe tag to look for.
Returns
The global TagHandler if the tag was found; Null otherwise.
static void Wrench.TagHandlers.Setup ( )
inlinestatic

Sets up the global lookup by searching for any classes which inherit from TagHandler.

Member Data Documentation

Dictionary<string,TagHandler> Wrench.TagHandlers.Handlers
static

The lookup itself. Matches tag text (e.g. "div") to the handler that will process it.