Class TagContainer
Base class for classes exposing template tags.
Inheritance
Inherited Members
Namespace: SuperOffice.IO
Assembly: SoCore.dll
Syntax
public abstract class TagContainer
Constructors
TagContainer()
Base class for classes exposing template tags.
Declaration
protected TagContainer()
Fields
_bInitiated
State about the object has been initiated. Data (e.g. AddData(params object[])) can only be added before initiation. Call base.Init() to set this value to true.
Declaration
protected bool _bInitiated
Field Value
Type | Description |
---|---|
bool |
Properties
CurrentUiCulture
Current UI culture, this is currently the language code used in template processing
Declaration
public string CurrentUiCulture { get; set; }
Property Value
Type | Description |
---|---|
string |
Data
Retrieve data that can be used when
Declaration
protected object[] Data { get; }
Property Value
Type | Description |
---|---|
object[] |
Id
Primary key of the
Declaration
public abstract int Id { get; }
Property Value
Type | Description |
---|---|
int |
Methods
AddData(params object[])
Add data to be used when retrieving template variables. Use when you have (possibly unsaved) Entity objects that you wish to pass in.
Declaration
public virtual void AddData(params object[] data)
Parameters
Type | Name | Description |
---|---|---|
object[] | data | Data to be used when retrieving template variables. For instance, Entity objects |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if data is added after it has been used (e.g. through GetValue(string)). |
ClearData()
Clear cached data
Declaration
public void ClearData()
GetData()
Get cached data objects
Declaration
public virtual object[] GetData()
Returns
Type | Description |
---|---|
object[] | Array with all cached data objects |
GetTags()
Get list of tags in the current TagContainer.
Declaration
public string[] GetTags()
Returns
Type | Description |
---|---|
string[] |
GetValue(string)
Get a value for a tag.
Declaration
public virtual string GetValue(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag. |
Returns
Type | Description |
---|---|
string | Value of the tag. An empty string (e.g. Empty) is returned if there is no valid value. |
Init()
Set the object in an initaited state. This means that no data can be added (e.g. AddData(params object[])) beyound this point.
Declaration
protected virtual void Init()
IsTagInContext(string)
Is this a valid tag in the given context. If there are no current sale, there are no valid tags for sale.
Declaration
public virtual bool IsTagInContext(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | theName of the tag. |
Returns
Type | Description |
---|---|
bool | True if tag is valid in hte given context. |
IsTagLegal(string)
Is this a legal tag?
Declaration
public virtual bool IsTagLegal(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag. |
Returns
Type | Description |
---|---|
bool | True is returned if this is a legal tag. |
RemoveCustomValue(string)
Remove an existing custom tag
Declaration
public void RemoveCustomValue(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag |
SetValue(string, string)
Add a custom tag/value pair
Declaration
public void SetValue(string tag, string value)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag |
string | value | Value of the tag |