GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    TextElementCollection Class

    Namespace:
    GemBox.Spreadsheet.Drawing
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a collection of TextElements.

    • C#
    • VB.NET
    public class TextElementCollection : IEnumerable<TextElement>, IEnumerable
    Public Class TextElementCollection
        Implements IEnumerable(Of TextElement), IEnumerable
    Inheritance:
    System.Object
    TextElementCollection
    Implements
    System.Collections.Generic.IEnumerable<TextElement>
    System.Collections.IEnumerable

    Properties

    Count

    Gets the number of TextElements contained in the collection.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of TextElements contained in the collection.

    Item[Int32]

    Gets or sets the TextElement at the specified index.

    • C#
    • VB.NET
    public TextElement this[int index] { get; }
    Public ReadOnly Property Item(index As Integer) As TextElement
    Parameters
    index
    System.Int32
    Property Value
    TextElement

    The TextElement at the specified index.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    Methods

    AddLineBreak()

    Adds a new line break to the paragraph.

    • C#
    • VB.NET
    public TextLineBreak AddLineBreak()
    Public Function AddLineBreak As TextLineBreak
    Returns
    TextLineBreak

    The line break added to the paragraph.

    AddRun(String)

    Adds a new run of text to the paragraph.

    • C#
    • VB.NET
    public TextRun AddRun(string text)
    Public Function AddRun(text As String) As TextRun
    Parameters
    text
    System.String

    The text.

    Returns
    TextRun

    The run of text added to the paragraph.

    Exceptions
    System.ArgumentException

    Parameter text is either null or System.String.Empty, or it contains character '\v', '\r' or '\n'. Character '\v' represents a line break and a TextLineBreak instance should be added instead. Characters '\r' and '\n' represent a paragraph break and a TextParagraph instance should be added instead.

    Clear()

    Removes all TextElements from the collection.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    Contains(TextElement)

    Determines whether a TextElement is in the collection.

    • C#
    • VB.NET
    public bool Contains(TextElement item)
    Public Function Contains(item As TextElement) As Boolean
    Parameters
    item
    TextElement

    The TextElement to locate in the collection.

    Returns
    System.Boolean

    true if item is found in the collection; otherwise, false.

    Exceptions
    System.ArgumentNullException

    item is null.

    GetEnumerator()

    Returns an enumerator that iterates through the TextElementCollection.

    • C#
    • VB.NET
    public IEnumerator<TextElement> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of TextElement)
    Returns
    System.Collections.Generic.IEnumerator<TextElement>

    An System.Collections.Generic.IEnumerator<T> for the collection.

    IndexOf(TextElement)

    Searches for the specified TextElement and returns the zero-based index of the first occurrence within the entire collection.

    • C#
    • VB.NET
    public int IndexOf(TextElement item)
    Public Function IndexOf(item As TextElement) As Integer
    Parameters
    item
    TextElement

    The TextElement to locate in the collection.

    Returns
    System.Int32

    The zero-based index of the first occurrence of item within the entire collection, if found; otherwise, -1.

    Remove(TextElement)

    Removes the first occurrence of a specific TextElement from the collection.

    • C#
    • VB.NET
    public bool Remove(TextElement item)
    Public Function Remove(item As TextElement) As Boolean
    Parameters
    item
    TextElement

    The TextElement to remove from the collection.

    Returns
    System.Boolean

    true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the original collection.

    RemoveAt(Int32)

    Removes the TextElement at the specified index of the collection.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32

    The zero-based index of the TextElement to remove.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    See Also

    Elements
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.