TextParagraphCollection Class
Represents a collection of TextParagraphs.
public class TextParagraphCollection : IEnumerable<TextParagraph>, IEnumerablePublic Class TextParagraphCollection
Implements IEnumerable(Of TextParagraph), IEnumerable- Inheritance:
- System.ObjectTextParagraphCollection
Properties
Count
Gets the number of TextParagraphs contained in the collection.
Property Value
- System.Int32
The number of TextParagraphs contained in the collection.
Item[Int32]
Gets the TextParagraph at the specified index.
public TextParagraph this[int index] { get; }Public ReadOnly Property Item(index As Integer) As TextParagraphParameters
index- System.Int32
Property Value
The TextParagraph at the specified index.
Exceptions
- System.ArgumentOutOfRangeException
index is less than zero or index is equal to or greater than Count.
Methods
Add()
Adds a new paragraph to the text box.
Returns
The paragraph added to the text box.
Clear()
Removes all TextParagraphs from the collection.
Contains(TextParagraph)
Determines whether a TextParagraph is in the collection.
public bool Contains(TextParagraph item)Public Function Contains(item As TextParagraph) As BooleanParameters
item- TextParagraph
The TextParagraph 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 TextParagraphCollection.
public IEnumerator<TextParagraph> GetEnumerator()Public Function GetEnumerator As IEnumerator(Of TextParagraph)Returns
- System.Collections.Generic.IEnumerator<TextParagraph>
An System.Collections.Generic.IEnumerator<T> for the collection.
IndexOf(TextParagraph)
Searches for the specified TextParagraph and returns the zero-based index of the first occurrence within the entire collection.
public int IndexOf(TextParagraph item)Public Function IndexOf(item As TextParagraph) As IntegerParameters
item- TextParagraph
The TextParagraph 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(TextParagraph)
Removes the first occurrence of a specific TextParagraph from the collection.
public bool Remove(TextParagraph item)Public Function Remove(item As TextParagraph) As BooleanParameters
item- TextParagraph
The TextParagraph 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 TextParagraph at the specified index of the collection.
Parameters
index- System.Int32
The zero-based index of the TextParagraph to remove.
Exceptions
- System.ArgumentOutOfRangeException
index is less than zero or index is equal to or greater than Count.