Wrench.LanguageTag Class Reference

Detailed Description

This handles the language tag at the top of a language file. It must define the name and code of the language.

Inheritance diagram for Wrench.LanguageTag:
Wrench.LanguageTagHandler Wrench.TagHandler

Public Member Functions

override string[] GetTags ()
 Returns all tags that are handled by this handler, e.g. "div" or "span". Usually there will be just one in the set but some tags may wish to have more. More...
 
override bool SelfClosing ()
 Returns true if this tag has no kids and closes itself. For example <input type='text' />. Note that this method exists to make that final slash essentially optional. More...
 
override TagHandler GetInstance ()
 Makes a new instance of this tag handler. A global instance is made of this handler so this is used to generate a new instance in an efficient way. More...
 
void Apply (LanguageSet language, LanguageElement element)
 Applies this tag to the given language. More...
 
- Public Member Functions inherited from Wrench.LanguageTagHandler
 LanguageTagHandler ()
 
- Public Member Functions inherited from Wrench.TagHandler
virtual void OnTagLoaded ()
 Called when the tag is instanced and the element plus its attributes and kids have been fully parsed. More...
 
virtual void OnParseContent (MLLexer lexer)
 Called when the parser is reading the content of this tag for custom reading, e.g. a script/style tag. Non-self closing tags only. Anything that's not read by this method is assumed to be a child element. More...
 
virtual bool OnAttributeChange (string attribute)
 Called on an instance of this handler when an attribute on the element it's attached to changes. It's also called when the tag is being loaded. More...
 

Additional Inherited Members

- Public Attributes inherited from Wrench.TagHandler
int Priority
 If you define a tag handler with tags which already exist, this priority allows your tag to override the existing one optionally. All system tags have a priority of zero. More...
 
string TagExtension
 This is applied to every derivative of this tag handler. This enables tags to be grouped by file they are handling. e.g. "ui" extension and tag name "div" would become "ui-div" internally. More...
 

Member Function Documentation

void Wrench.LanguageTag.Apply ( LanguageSet  language,
LanguageElement  element 
)
inline

Applies this tag to the given language.

Parameters
languageThe language that this tag came from.
elementThe element from the language file that contains the language name and code as attributes.
override TagHandler Wrench.LanguageTag.GetInstance ( )
inlinevirtual

Makes a new instance of this tag handler. A global instance is made of this handler so this is used to generate a new instance in an efficient way.

Reimplemented from Wrench.TagHandler.

override string [] Wrench.LanguageTag.GetTags ( )
inlinevirtual

Returns all tags that are handled by this handler, e.g. "div" or "span". Usually there will be just one in the set but some tags may wish to have more.

Reimplemented from Wrench.TagHandler.

override bool Wrench.LanguageTag.SelfClosing ( )
inlinevirtual

Returns true if this tag has no kids and closes itself. For example <input type='text' />. Note that this method exists to make that final slash essentially optional.

Reimplemented from Wrench.TagHandler.