Class FormatSection
Class used for Format Section.
Inherited Members
Namespace: Syncfusion.XlsIO.FormatParser
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class FormatSection : CommonObject, IParentApplication, IDisposable
Constructors
FormatSection(IApplication, object, List<FormatTokenBase>)
Initializes a new instance of the FormatSection class based on array of tokens.
Declaration
public FormatSection(IApplication application, object parent, List<FormatTokenBase> arrTokens)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | application | Represents current application. |
| object | parent | Represents parent object. |
| List<FormatTokenBase> | arrTokens | Array of section's tokens. |
Properties
Count
Gets the number of tokens in the section.
Declaration
public int Count { get; }
Property Value
| Type |
|---|
| int |
Culture
Gets the culture used for conversion. Read-only.
Declaration
public CultureInfo Culture { get; }
Property Value
| Type |
|---|
| CultureInfo |
DecimalNumber
Gets the number of digits after "." sign. Read-only.
Declaration
public int DecimalNumber { get; }
Property Value
| Type |
|---|
| int |
FormatType
Gets the section type.
Declaration
public ExcelFormatType FormatType { get; }
Property Value
| Type |
|---|
| ExcelFormatType |
HasCondition
Gets a value indicating whether section contains condition. Read-only.
Declaration
public bool HasCondition { get; }
Property Value
| Type |
|---|
| bool |
IsFraction
Gets a value indicating whether number format contains fraction sign. Read-only.
Declaration
public bool IsFraction { get; }
Property Value
| Type |
|---|
| bool |
IsScientific
Gets a value indicating whether section contains E/E+ or E- signs in format string.
Declaration
public bool IsScientific { get; }
Property Value
| Type |
|---|
| bool |
IsThousandSeparator
Gets a value indicating whether thousand separator is present in number format. Read-only.
Declaration
public bool IsThousandSeparator { get; }
Property Value
| Type |
|---|
| bool |
this[int]
Returns single token from the section. Read-only.
Declaration
public FormatTokenBase this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type |
|---|
| FormatTokenBase |
Methods
ApplyFormat(double)
Applies format to the value.
Declaration
public string ApplyFormat(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value to apply format to. |
Returns
| Type | Description |
|---|---|
| string | String representation of the value. |
ApplyFormat(double, bool)
Applies format to the value.
Declaration
public string ApplyFormat(double value, bool bShowReservedSymbols)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value to apply format to. |
| bool | bShowReservedSymbols | Indicates whether to show reserved symbols. |
Returns
| Type | Description |
|---|---|
| string | String representation of the value. |
ApplyFormat(string)
Applies format to the value.
Declaration
public string ApplyFormat(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | Value to apply format to. |
Returns
| Type | Description |
|---|---|
| string | String representation of the value. |
ApplyFormat(string, bool)
Applies format to the value.
Declaration
public string ApplyFormat(string value, bool bShowReservedSymbols)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | Value to apply format to. |
| bool | bShowReservedSymbols | Indicates whether to show reserved symbols. |
Returns
| Type | Description |
|---|---|
| string | String representation of the value. |
CheckCondition(double)
Checks whether value value meets the condition.
Declaration
public bool CheckCondition(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value to check. |
Returns
| Type | Description |
|---|---|
| bool | True if value meets the condition; otherwise returns False. |
Clone(object)
Creates a new object that is a copy of the current instance.
Declaration
public object Clone(object parent)
Parameters
| Type | Name | Description |
|---|---|---|
| object | parent | Represents parent object. |
Returns
| Type | Description |
|---|---|
| object | A new object that is a copy of this instance. |
FindCorrespondingHourSection(int)
Searches for corresponding hour token.
Declaration
public HourToken FindCorrespondingHourSection(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Start index to search. |
Returns
| Type | Description |
|---|---|
| HourToken | Corresponding hour token. |
PrepareFormat()
Prepares format if necessary.
Declaration
public void PrepareFormat()