Dom.TagHandlers Class Reference

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 Dictionary< string, Type > GetAll ()
 Gets all available tag handlers. Note that interally lookups go through MLNamespace.Tags instead. More...
 
static void Clear ()
 Clears all tag handlers. More...
 
static bool Add (Type elementType)
 Adds an element type to the set. This is generally done automatically, but you can also add it manually if you wish. More...
 
static SupportedTagMeta Get (MLNamespace ns, string tag)
 Gets the metadata for the given tag. More...
 
static Element Create (MLNamespace ns, string tag)
 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...
 

Member Function Documentation

static bool Dom.TagHandlers.Add ( Type  elementType)
inlinestatic

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

Parameters
elementTypeThe type to add.
Returns
True if adding it was successful.
static void Dom.TagHandlers.Clear ( )
inlinestatic

Clears all tag handlers.

static Element Dom.TagHandlers.Create ( MLNamespace  ns,
string  tag 
)
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
nsThe namespace the tag is in.
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 SupportedTagMeta Dom.TagHandlers.Get ( MLNamespace  ns,
string  tag 
)
inlinestatic

Gets the metadata for the given tag.

static Dictionary<string,Type> Dom.TagHandlers.GetAll ( )
inlinestatic

Gets all available tag handlers. Note that interally lookups go through MLNamespace.Tags instead.