TabStopCollection Class
Represents a collection of custom tab stops that are to be used within a TextParagraph.
This collection is sorted based on Position property.
public sealed class TabStopCollection : Collection<TabStop>, IList, ICollection, IList<TabStop>, ICollection<TabStop>, IEnumerable<TabStop>, IEnumerable
Public NotInheritable Class TabStopCollection
Inherits Collection(Of TabStop)
Implements IList, ICollection, IList(Of TabStop), ICollection(Of TabStop), IEnumerable(Of TabStop), IEnumerable
- Inheritance:
- System.ObjectTabStopCollection
Implements
Properties
Count
Gets the number of TabStops contained in the collection.
Property Value
- System.Int32
The number of TabStops contained in the collection.
DefaultSize
Gets or sets the default size for a tab character within this TextParagraph.
Default value is 2.54 cm (1 inch).
Property Value
The default size for a tab character within this TextParagraph.
Item[Int32]
Gets the TabStop at the specified index.
public TabStop this[int index] { get; }
Public ReadOnly Property Item(index As Integer) As TabStop
Parameters
index
- System.Int32
The zero-based index of the TabStop to get or set.
Property Value
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
Methods
Clear()
Removes all TabStops from the collection.
Contains(TabStop)
Determines whether a TabStop is in the collection.
Parameters
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 TabStopCollection.
public IEnumerator<TabStop> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of TabStop)
Returns
- System.Collections.Generic.IEnumerator<TabStop>
An System.Collections.Generic.IEnumerator<T> for the collection.
IndexOf(TabStop)
Searches for the specified TabStop and returns the zero-based index of the first occurrence within the entire collection.
Parameters
Returns
- System.Int32
The zero-based index of the first occurrence of item
within the entire collection, if found; otherwise, -1.
Remove(Length)
Removes the tab stop at the specified position from the TabStopCollection.
Parameters
position
- Length
The position of the tab stop to remove.
Returns
- System.Boolean
true if tab stop is successfully removed; otherwise, false. This method also returns false if tab stop was not found at the specified position in the TabStopCollection.
Remove(TabStop)
Removes the first occurrence of a specific TabStop from the collection.
Parameters
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 TabStop at the specified index of the collection.
Parameters
index
- System.Int32
The zero-based index of the TabStop to remove.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
Set(Length, TabStopAlignment)
Sets the tab stop at the specified position and of the specified alignment.
public TabStop Set(Length position, TabStopAlignment alignment)
Public Function Set(position As Length, alignment As TabStopAlignment) As TabStop
Parameters
position
- Length
The tab stop position.
alignment
- TabStopAlignment
The tab stop alignment.
Returns
A TabStop instance that was set to TabStopCollection.
Exceptions
- System.ArgumentOutOfRangeException
position
is less than zero.