Class TextWithFormat
Summary description for TextFormat.
Inheritance
Implements
Namespace: Syncfusion.XlsIO.Parser.Biff_Records
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class TextWithFormat : Object, IComparable, ICloneable
Constructors
TextWithFormat()
Default constructor.
Declaration
public TextWithFormat()
TextWithFormat(Int32)
Creates instance with specified default font index.
Declaration
public TextWithFormat(int fontIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fontIndex | Index of the default font. |
Fields
RefCount
Number of references to this object.
Declaration
public int RefCount
Field Value
Type |
---|
System.Int32 |
Properties
DefaultFontIndex
Gets / sets default font index.
Declaration
public int DefaultFontIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
FormattingRuns
Formatting runs, key - position, value - font index.
Declaration
public SortedList<int, int> FormattingRuns { get; }
Property Value
Type |
---|
System.Collections.Generic.SortedList<System.Int32, System.Int32> |
FormattingRunsCount
Returns number of formatting runs. Read-only.
Declaration
public int FormattingRunsCount { get; }
Property Value
Type |
---|
System.Int32 |
IsPreserved
Returns true if string is preserved type.
Declaration
public bool IsPreserved { get; set; }
Property Value
Type |
---|
System.Boolean |
Text
Text string.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |
Methods
CheckOffset(Int32, Int32)
Checks if specified offset is correct.
Declaration
public static void CheckOffset(int len, int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | len | Length of the array. |
System.Int32 | iOffset | Offset in the array. |
Exceptions
Type | Condition |
---|---|
System.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 |
---|---|
System.Object | A new object that is a copy of this instance. |
Clone(Dictionary<Int32, Int32>)
Creates a new object that is a copy of the current instance.
Declaration
public TextWithFormat Clone(Dictionary<int, int> dicFontIndexes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | dicFontIndexes | Dictionary with new font indexes. |
Returns
Type | Description |
---|---|
TextWithFormat | A new object that is a copy of this instance. |
CompareFormattingRuns(SortedList<Int32, Int32>, SortedList<Int32, Int32>)
Compares formatting runs.
Declaration
public static int CompareFormattingRuns(SortedList<int, int> fRuns1, SortedList<int, int> fRuns2)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.SortedList<System.Int32, System.Int32> | fRuns1 | First formatting runs to compare. |
System.Collections.Generic.SortedList<System.Int32, System.Int32> | fRuns2 | Second formatting runs to compare. |
Returns
Type | Description |
---|---|
System.Int32 | 0 if they are equal, -1 if first formatting run is less then second; otherwise 1. |
CompareTo(Object)
Compares the current instance with another object of the same type.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Int32 | 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 |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified object is equal to the current object; otherwise False. |
GetFontByIndex(Int32)
Returns font index at the specified position in the formatting runs array.
Declaration
public int GetFontByIndex(int iIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex | Index of the formatting run. |
Returns
Type | Description |
---|---|
System.Int32 | Font index. |
GetFormattingSize()
Returns size of the formatting runs.
Declaration
public int GetFormattingSize()
Returns
Type | Description |
---|---|
System.Int32 | Size of the formatting runs. |
GetHashCode()
Returns hashcode for the object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current object. |
GetOptions()
Returns string options.
Declaration
public TextWithFormat.StringType GetOptions()
Returns
Type | Description |
---|---|
TextWithFormat.StringType | Options byte. |
GetPositionByIndex(Int32)
Returns character position at the specified position in the formatting runs array.
Declaration
public int GetPositionByIndex(int iIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex | Index of the formatting run. |
Returns
Type | Description |
---|---|
System.Int32 | Character position. |
GetTextFontIndex(Int32)
Returns font index for the specified character.
Declaration
public int GetTextFontIndex(int iPos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iPos | Character index to get font index. |
Returns
Type | Description |
---|---|
System.Int32 | Font index for the specified character. |
GetTextFontIndex(Int32, Boolean)
Returns font index for the specified character.
Declaration
public int GetTextFontIndex(int iPos, bool iscopy)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iPos | Character index to get font index. |
System.Boolean | iscopy |
Returns
Type | Description |
---|---|
System.Int32 | Font index for the specified character. |
GetTextSize()
Evaluates size of the text in bytes.
Declaration
public int GetTextSize()
Returns
Type | Description |
---|---|
System.Int32 | Returns text size in bytes. |
Parse(Byte[], Int32)
Parses byte array.
Declaration
public virtual int Parse(byte[] data, int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Array of bytes to parse. |
System.Int32 | iOffset | Offset of the object's data in the array. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the object in the data array. |
SerializeFormatting()
Serializes formatting.
Declaration
public byte[] SerializeFormatting()
Returns
Type | Description |
---|---|
System.Byte[] | Returns array of bytes that contains formatting data. |
SerializeFormatting(Byte[], Int32, Boolean)
Serializes formatting.
Declaration
public int SerializeFormatting(byte[] arrBuffer, int iOffset, bool bDefragment)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | arrBuffer | Buffer for formatting data. |
System.Int32 | iOffset | Offset in the buffer where to serialize formatting. |
System.Boolean | bDefragment | Indicates whether defragmentation is needed. |
Returns
Type | Description |
---|---|
System.Int32 | Size of formatting data. |
SetFontByIndex(Int32, Int32)
Sets font index at the specified position in the formatting runs array.
Declaration
public void SetFontByIndex(int index, int iFontIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the formatting run. |
System.Int32 | iFontIndex | Font index to set. |
SetTextFontIndex(Int32, Int32, Int32)
Sets font index for specified range of characters.
Declaration
public void SetTextFontIndex(int iStartPos, int iEndPos, int iFontIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iStartPos | Start character of the range. |
System.Int32 | iEndPos | End character of the range. |
System.Int32 | iFontIndex | Font index to set. |
ToString()
Converts this object to string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of this object. |
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(String to TextWithFormat)
Converts string to TextWithFormat.
Declaration
public static explicit operator TextWithFormat(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String value. |
Returns
Type | Description |
---|---|
TextWithFormat | Converted TextWithFormat. |
Implicit(TextWithFormat to String)
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 |
---|---|
System.String | String value of the object. |