Class FormatTokenBase
Base class for formula tokens.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.FormatParser.FormatTokens
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public abstract class FormatTokenBase : ICloneable
Constructors
FormatTokenBase()
Initializes a new instance of the FormatTokenBase class
Declaration
public FormatTokenBase()
Fields
DEF_OPTIONS
Default regular expressions options:
Declaration
protected const RegexOptions DEF_OPTIONS
Field Value
Type | Description |
---|---|
System.Text.RegularExpressions.RegexOptions |
m_strFormat
Part of format.
Declaration
protected string m_strFormat
Field Value
Type | Description |
---|---|
System.String |
Properties
Format
Gets or sets format of the token.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TokenType
Gets type of the token. Read-only.
Declaration
public abstract TokenType TokenType { get; }
Property Value
Type | Description |
---|---|
TokenType |
Methods
ApplyFormat(ref Double)
Applies format to the value.
Declaration
public virtual string ApplyFormat(ref double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to format. |
Returns
Type | Description |
---|---|
System.String | Formatted value. |
ApplyFormat(ref Double, Boolean, CultureInfo, FormatSection)
Applies format to the value.
Declaration
public abstract string ApplyFormat(ref double value, bool bShowHiddenSymbols, CultureInfo culture, FormatSection section)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to format. |
System.Boolean | bShowHiddenSymbols | Indicates whether to put in result hidden symbols. |
System.Globalization.CultureInfo | culture | Culture used to convert value into text. |
FormatSection | section | Parent section. |
Returns
Type | Description |
---|---|
System.String | Formatted value. |
ApplyFormat(String)
Applies format to the value.
Declaration
public virtual string ApplyFormat(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value to format. |
Returns
Type | Description |
---|---|
System.String | Formatted value. |
ApplyFormat(String, Boolean)
Applies format to the value.
Declaration
public abstract string ApplyFormat(string value, bool bShowHiddenSymbols)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value to format. |
System.Boolean | bShowHiddenSymbols | Indicates whether to put in result hidden symbols. |
Returns
Type | Description |
---|---|
System.String | Formatted value. |
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
FindString(String[], String, Int32, Boolean)
Searches for string from strings array in the format starting from the specified position.
Declaration
public int FindString(string[] arrStrings, string strFormat, int iIndex, bool bIgnoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | arrStrings | Array of strings to check. |
System.String | strFormat | String format to search in. |
System.Int32 | iIndex | Start index in the format. |
System.Boolean | bIgnoreCase | Indicates whether to ignore case. |
Returns
Type | Description |
---|---|
System.Int32 | String index or -1 if not found. |
OnFormatChange()
This method is called after format string was changed.
Declaration
protected virtual void OnFormatChange()
TryParse(String, Int32)
Tries to parse format string.
Declaration
public abstract int TryParse(string strFormat, int iIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFormat | Format string to parse. |
System.Int32 | iIndex | Position to start parsing at. |
Returns
Type | Description |
---|---|
System.Int32 | Position after parsed block. |
TryParseRegex(Regex, String, Int32)
Tries to parse format string using regular expression.
Declaration
protected int TryParseRegex(Regex regex, string strFormat, int iIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Text.RegularExpressions.Regex | regex | Regular expression to use. |
System.String | strFormat | Format string to parse. |
System.Int32 | iIndex | Start index. |
Returns
Type | Description |
---|---|
System.Int32 | Position after parsing. |
TryParseRegex(Regex, String, Int32, out Match)
Tries to parse format string using regular expression.
Declaration
protected int TryParseRegex(Regex regex, string strFormat, int iIndex, out Match m)
Parameters
Type | Name | Description |
---|---|---|
System.Text.RegularExpressions.Regex | regex | Regular expression to use. |
System.String | strFormat | Format string to parse. |
System.Int32 | iIndex | Start index. |
System.Text.RegularExpressions.Match | m | Output regular expression match. |
Returns
Type | Description |
---|---|
System.Int32 | Position after parsing. |