Class TextWithFormat
Summary description for TextFormat.
Inherited Members
Namespace: Syncfusion.XlsIO.Parser.Biff_Records
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class TextWithFormat : IComparable, ICloneable
Constructors
TextWithFormat()
Default constructor.
Declaration
public TextWithFormat()
TextWithFormat(int)
Creates instance with specified default font index.
Declaration
public TextWithFormat(int fontIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | fontIndex | Index of the default font. |
Fields
RefCount
Number of references to this object.
Declaration
public int RefCount
Field Value
| Type |
|---|
| int |
Properties
DefaultFontIndex
Gets / sets default font index.
Declaration
public int DefaultFontIndex { get; set; }
Property Value
| Type |
|---|
| int |
FormattingRunsCount
Returns number of formatting runs. Read-only.
Declaration
public int FormattingRunsCount { get; }
Property Value
| Type |
|---|
| int |
IsPreserved
Returns true if string is preserved type.
Declaration
public bool IsPreserved { get; set; }
Property Value
| Type |
|---|
| bool |
Text
Text string.
Declaration
public string Text { get; set; }
Property Value
| Type |
|---|
| string |
Methods
CheckOffset(int, int)
Checks if specified offset is correct.
Declaration
public static void CheckOffset(int len, int iOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| int | len | Length of the array. |
| int | iOffset | Offset in the array. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | When iOffset is out of range. |
ClearFormatting()
Clears formatting.
Declaration
public void ClearFormatting()
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| object | A new object that is a copy of this instance. |
Clone(Dictionary<int, int>)
Creates a new object that is a copy of the current instance.
Declaration
public TextWithFormat Clone(Dictionary<int, int> dicFontIndexes)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<int, int> | dicFontIndexes | Dictionary with new font indexes. |
Returns
| Type | Description |
|---|---|
| TextWithFormat | A new object that is a copy of this instance. |
CompareTo(object)
Compares the current instance with another object of the same type.
Declaration
public int CompareTo(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | An object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that indicates the relative order of the comparands. |
CopyFormattingTo(TextWithFormat)
Copies formatting runs into another TextWithFormat object.
Declaration
public void CopyFormattingTo(TextWithFormat twin)
Parameters
| Type | Name | Description |
|---|---|---|
| TextWithFormat | twin | TextWithFormat to copy data into. |
Defragment()
Defragments text formatting.
Declaration
public void Defragment()
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | True if the specified object is equal to the current object; otherwise False. |
Overrides
GetFontByIndex(int)
Returns font index at the specified position in the formatting runs array.
Declaration
public int GetFontByIndex(int iIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iIndex | Index of the formatting run. |
Returns
| Type | Description |
|---|---|
| int | Font index. |
GetFormattingSize()
Returns size of the formatting runs.
Declaration
public int GetFormattingSize()
Returns
| Type | Description |
|---|---|
| int | Size of the formatting runs. |
GetHashCode()
Returns hashcode for the object.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
GetOptions()
Returns string options.
Declaration
public TextWithFormat.StringType GetOptions()
Returns
| Type | Description |
|---|---|
| TextWithFormat.StringType | Options byte. |
GetPositionByIndex(int)
Returns character position at the specified position in the formatting runs array.
Declaration
public int GetPositionByIndex(int iIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iIndex | Index of the formatting run. |
Returns
| Type | Description |
|---|---|
| int | Character position. |
GetTextFontIndex(int)
Returns font index for the specified character.
Declaration
public int GetTextFontIndex(int iPos)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iPos | Character index to get font index. |
Returns
| Type | Description |
|---|---|
| int | Font index for the specified character. |
GetTextFontIndex(int, bool)
Returns font index for the specified character.
Declaration
public int GetTextFontIndex(int iPos, bool iscopy)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iPos | Character index to get font index. |
| bool | iscopy |
Returns
| Type | Description |
|---|---|
| int | Font index for the specified character. |
GetTextSize()
Evaluates size of the text in bytes.
Declaration
public int GetTextSize()
Returns
| Type | Description |
|---|---|
| int | Returns text size in bytes. |
Parse(byte[], int)
Parses byte array.
Declaration
public virtual int Parse(byte[] data, int iOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | Array of bytes to parse. |
| int | iOffset | Offset of the object's data in the array. |
Returns
| Type | Description |
|---|---|
| int | Size of the object in the data array. |
SerializeFormatting()
Serializes formatting.
Declaration
public byte[] SerializeFormatting()
Returns
| Type | Description |
|---|---|
| byte[] | Returns array of bytes that contains formatting data. |
SerializeFormatting(byte[], int, bool)
Serializes formatting.
Declaration
public int SerializeFormatting(byte[] arrBuffer, int iOffset, bool bDefragment)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | arrBuffer | Buffer for formatting data. |
| int | iOffset | Offset in the buffer where to serialize formatting. |
| bool | bDefragment | Indicates whether defragmentation is needed. |
Returns
| Type | Description |
|---|---|
| int | Size of formatting data. |
SetFontByIndex(int, int)
Sets font index at the specified position in the formatting runs array.
Declaration
public void SetFontByIndex(int index, int iFontIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of the formatting run. |
| int | iFontIndex | Font index to set. |
SetTextFontIndex(int, int, int)
Sets font index for specified range of characters.
Declaration
public void SetTextFontIndex(int iStartPos, int iEndPos, int iFontIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iStartPos | Start character of the range. |
| int | iEndPos | End character of the range. |
| int | iFontIndex | Font index to set. |
ToString()
Converts this object to string.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | String representation of this object. |
Overrides
TypedClone()
Creates a new object that is a copy of the current instance.
Declaration
public TextWithFormat TypedClone()
Returns
| Type | Description |
|---|---|
| TextWithFormat | A new object that is a copy of this instance. |
Operators
explicit operator TextWithFormat(string)
Converts string to TextWithFormat.
Declaration
public static explicit operator TextWithFormat(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | String value. |
Returns
| Type | Description |
|---|---|
| TextWithFormat | Converted TextWithFormat. |
implicit operator string(TextWithFormat)
Converts TextWithFormat to string.
Declaration
public static implicit operator string(TextWithFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| TextWithFormat | format | Object to convert to string. |
Returns
| Type | Description |
|---|---|
| string | String value of the object. |