Class RichTextString
Represents rich text string in the workbook.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class RichTextString : CommonWrapper, ICloneParent, IRichTextString, IParentApplication, IOptimizedUpdate
Constructors
RichTextString(IApplication, Object)
Initializes new instance of the RichTextString.
Declaration
public RichTextString(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the RichTextString. |
System.Object | parent | Parent object for the RichTextString. |
RichTextString(IApplication, Object, TextWithFormat)
Initializes new instance of the RichTextString.
Declaration
public RichTextString(IApplication application, object parent, TextWithFormat text)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the RichTextString. |
System.Object | parent | Parent object for the RichTextString. |
TextWithFormat | text | Text to wrap. |
RichTextString(IApplication, Object, Boolean)
Initializes new instance of the RichTextString.
Declaration
public RichTextString(IApplication application, object parent, bool isReadOnly)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the RichTextString. |
System.Object | parent | Parent object for the RichTextString. |
System.Boolean | isReadOnly | Indicates whether string is read-only. |
RichTextString(IApplication, Object, Boolean, Boolean)
Initializes new instance of the RichTextString.
Declaration
public RichTextString(IApplication application, object parent, bool isReadOnly, bool bCreateText)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the RichTextString. |
System.Object | parent | Parent object for the RichTextString. |
System.Boolean | isReadOnly | Indicates whether string is read-only. |
System.Boolean | bCreateText | Indicates whether to create inner TextWithFormat. |
RichTextString(IApplication, Object, Object, Boolean, Boolean)
Initializes new instance of the RichTextString.
Declaration
public RichTextString(IApplication application, object parent, object rtfParent, bool isReadOnly, bool bCreateText)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the RichTextString. |
System.Object | parent | Parent object for the RichTextString. |
System.Object | rtfParent | |
System.Boolean | isReadOnly | Indicates whether string is read-only. |
System.Boolean | bCreateText | Indicates whether to create inner TextWithFormat. |
Fields
m_book
Parent workbook.
Declaration
protected WorkbookImpl m_book
Field Value
Type | Description |
---|---|
WorkbookImpl |
m_lCellIndex
Cell index.
Declaration
protected long m_lCellIndex
Field Value
Type | Description |
---|---|
System.Int64 |
m_rtfParent
Represents the parent RTF object.
Declaration
protected object m_rtfParent
Field Value
Type | Description |
---|---|
System.Object |
m_text
Low level text object.
Declaration
protected TextWithFormat m_text
Field Value
Type | Description |
---|---|
TextWithFormat |
Properties
Application
Returns parent application object. Read-only.
Declaration
public IApplication Application { get; }
Property Value
Type | Description |
---|---|
IApplication |
DefaultFont
Returns default font. Read-only.
Declaration
public virtual FontImpl DefaultFont { get; }
Property Value
Type | Description |
---|---|
FontImpl |
DefaultFontIndex
Gets / sets default font index.
Declaration
public int DefaultFontIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsFormatted
Indicates whether rich text string has formatting runs. Read-only.
Declaration
public bool IsFormatted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Parent
Returns parent object. Read-only.
Declaration
public object Parent { get; }
Property Value
Type | Description |
---|---|
System.Object |
RtfText
Returns text in rtf format. Read-only.
Declaration
public string RtfText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
StringSize
Returns size of the string. Read-only.
Declaration
public SizeF StringSize { get; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF |
Text
Gets / sets text of the string.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TextObject
Returns text object. Read-only.
Declaration
public TextWithFormat TextObject { get; }
Property Value
Type | Description |
---|---|
TextWithFormat |
Workbook
Returns parent workbook. Read-only.
Declaration
public WorkbookImpl Workbook { get; }
Property Value
Type | Description |
---|---|
WorkbookImpl |
Methods
AddFont(IFont)
Adds font to all required collections..
Declaration
protected virtual int AddFont(IFont font)
Parameters
Type | Name | Description |
---|---|---|
IFont | font | Font to add. |
Returns
Type | Description |
---|---|
System.Int32 | Font index in the collection. |
Append(String, IFont)
Appends rich text string with specified text and font.
Declaration
public void Append(string text, IFont font)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to append. |
IFont | font | Font to use. |
BeginUpdate()
This method is called before any changes made to the rich text string.
Declaration
public override void BeginUpdate()
Overrides
Clear()
Clears string and formatting.
Declaration
public virtual void Clear()
ClearFormatting()
Clears string formatting.
Declaration
public void ClearFormatting()
Clone(Object)
Creates a copy of the current object.
Declaration
public override object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new object. |
Returns
Type | Description |
---|---|
System.Object | A copy of the current object. |
Overrides
CopyFrom(RichTextString, Dictionary<Int32, Int32>)
Copies data from another rich text string.
Declaration
public virtual void CopyFrom(RichTextString source, Dictionary<int, int> dicFontIndexes)
Parameters
Type | Name | Description |
---|---|---|
RichTextString | source | String to copy data from. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | dicFontIndexes | Dictionary with updated font indexes. |
EndUpdate()
This method is called after any changes made to the rich text string.
Declaration
public override void EndUpdate()
Overrides
GetFont(Int32)
Returns font which is applied to character at the specified position.
Declaration
public IFont GetFont(int iPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iPosition | Character index. |
Returns
Type | Description |
---|---|
IFont | Font which is applied to character at the specified position. |
GetFont(Int32, Boolean)
Returns font which is applied to character at the specified position.
Declaration
public IFont GetFont(int iPosition, bool isCopy)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iPosition | Character index. |
System.Boolean | isCopy |
Returns
Type | Description |
---|---|
IFont | Font which is applied to character at the specified position. |
GetFontByIndex(Int32)
Returns font by its index.
Declaration
protected virtual FontImpl GetFontByIndex(int iFontIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iFontIndex | Font index. |
Returns
Type | Description |
---|---|
FontImpl | Font that corresponds to the specified index. |
GetFontIndex(Int32)
Returns font index at the specified position.
Declaration
protected virtual int GetFontIndex(int iPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iPosition | Character index. |
Returns
Type | Description |
---|---|
System.Int32 | Font index. |
Parse(TextWithFormat, Dictionary<Int32, Int32>, ExcelParseOptions)
Parse rich text string.
Declaration
public virtual void Parse(TextWithFormat text, Dictionary<int, int> dicFontIndexes, ExcelParseOptions options)
Parameters
Type | Name | Description |
---|---|---|
TextWithFormat | text | TextWithFormat to parse. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | dicFontIndexes | Dictionary with updated font indexes. |
ExcelParseOptions | options | Parse options. |
SetFont(Int32, Int32, IFont)
Sets font for range of characters.
Declaration
public void SetFont(int iStartPos, int iEndPos, IFont font)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iStartPos | First character of the range. |
System.Int32 | iEndPos | Last character of the range. |
IFont | font | Font to set. |
SetParents()
Searches for all necessary parent objects.
Declaration
protected virtual void SetParents()
Substring(Int32, Int32)
Sub string
Declaration
public void Substring(int startIndex, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startIndex | |
System.Int32 | length |