Class TagToken
A Token representing a tag element.
Implements
Namespace: Sdl.Core.Bcm.BcmModel.Tokenization.Tokens
Assembly: Sdl.Core.Bcm.BcmModel.dll
Syntax
public class TagToken : Token, ICloneable<Token>
Constructors
TagToken()
Initializes a new instance with default values (used for XML serialization only).
Declaration
public TagToken()
TagToken(TagType, String, Int32, Int32, String, Boolean)
Initializes a new instance of the Tag class with the specified type and anchor.
Declaration
public TagToken(TagType type, string tagId, int anchor, int alignmentAnchor, string textEquivalent, bool canHide)
Parameters
Type | Name | Description |
---|---|---|
TagType | type | The tag type. |
System.String | tagId | The tag ID (user-defined) |
System.Int32 | anchor | The tag anchor. |
System.Int32 | alignmentAnchor | An alignment anchor (cross-segment), if available |
System.String | textEquivalent | A text equivalent string (ignored if the tag type is not TextPlaceholder or LockedContent) |
System.Boolean | canHide | True if the tag represents inline formatting, false otherwise |
Properties
AlignmentAnchor
Gets or sets the alignment anchor, which is used to align cross-segment tags. It only needs to be set for the start tag.
Declaration
public Nullable<int> AlignmentAnchor { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Anchor
Gets or sets the tag anchor, which is used to bracket two tags (connect start and end tag). The anchor is only relevant for start and end tags and has no cross-segment semantics.
Declaration
public Nullable<int> Anchor { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
CanHide
Gets or sets the CanHide flag
Declaration
public Nullable<bool> CanHide { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
TagId
Gets or sets the tag ID which is a cross-format ID assigned by the filters and which may be used to represent a cross-format formatting class (such as "bold").
Declaration
public string TagId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TagType
Gets or sets the tag type.
Declaration
public TagType TagType { get; set; }
Property Value
Type | Description |
---|---|
TagType |
TextEquivalent
Gets or sets the text equivalent string. This will only be valid for text placeholder tags.
Declaration
public string TextEquivalent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Type
Gets the type of Token.
Declaration
protected override string Type { get; }
Property Value
Type | Description |
---|---|
System.String | The type. |
Overrides
Methods
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of the object, for display purposes. |