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... | |
|
inlinestatic |
Adds a handler to the set. This is generally done automatically, but you can also add it manually if you wish.
handler | The handler to add. |
|
inlinestatic |
Gets the default TagHandler.
|
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".
tag | The tag to look for. |
defaultTag | If the given tag is not found, this is used instead. |
|
inlinestatic |
Attempts to find the named tag, returning the global handler if it's found.
tag | The tag to look for. |
|
inlinestatic |
Sets up the global lookup by searching for any classes which inherit from TagHandler.
|
static |
The lookup itself. Matches tag text (e.g. "div") to the handler that will process it.