TextRunCollection Class
NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls
An ordered collection of TextRun items belonging to a TextFlow.
public class TextRunCollection : ICollection
Properties
Count
public int Count { get; }
The number of runs in the collection.
index]
public TextRun this[int index] { get; set; }
Gets or sets the run at the given index.
SyncRoot
public object SyncRoot { get; }
Always null; the collection does not expose a synchronization root.
Methods
Add(string text, System.Drawing.Font font, Color foreColor)
public int Add(string text, System.Drawing.Font font, Color foreColor)
Creates a run from the given text, font, and color and adds it, returning its index.
Returns int
Add(TextRun textRun)
public int Add(TextRun textRun)
Adds an existing run to the collection and returns its index.
Returns int
Clear()
public void Clear()
Removes all runs from the collection.
Contains(TextRun run)
public bool Contains(TextRun run)
Returns whether the given run is in the collection.
Returns bool
IndexOf(TextRun run)
public int IndexOf(TextRun run)
Returns the index of the given run, or -1 if it is not present.
Returns int
Insert(int index, TextRun run)
public void Insert(int index, TextRun run)
Inserts a run at the given index.
Remove(TextRun run)
public void Remove(TextRun run)
Removes the given run from the collection.
RemoveAt(int index)
public void RemoveAt(int index)
Removes the run at the given index.
CopyTo(Array array, int index)
public void CopyTo(Array array, int index)
Copies the runs to the given array starting at the specified index.