Table of Contents

Class TextRunCollection

Namespace
nanoFramework.Presentation.Controls
Assembly
nanoFramework.Graphics.dll

Represents a collection of TextRun objects that can be added, removed, and modified.

public class TextRunCollection : ICollection, IEnumerable
Inheritance
TextRunCollection
Implements
Inherited Members
Extension Methods

Properties

Count

Gets the number of elements in the TextRunCollection.

public int Count { get; }

Property Value

int

IsSynchronized

Gets a value indicating whether access to the TextRunCollection is synchronized (thread safe).

public bool IsSynchronized { get; }

Property Value

bool

this[int]

Gets or sets the TextRun object at the specified index.

public TextRun this[int index] { get; set; }

Parameters

index int

The zero-based index of the TextRun to get or set.

Property Value

TextRun

The TextRun object at the specified index.

SyncRoot

Gets an object that can be used to synchronize access to the collection.

public object SyncRoot { get; }

Property Value

object

Methods

Add(string, Font, Color)

Adds a TextRun object to the TextRunCollection using the specified text, font, and foreground color, and returns the index at which the new TextRun was added.

public int Add(string text, Font font, Color foreColor)

Parameters

text string

The text for the new TextRun.

font Font

The font for the new TextRun.

foreColor Color

The foreground color for the new TextRun.

Returns

int

The index at which the new TextRun was added.

Add(TextRun)

Adds a TextRun object to the TextRunCollection and returns the index at which the new TextRun was added.

public int Add(TextRun textRun)

Parameters

textRun TextRun

The TextRun to add.

Returns

int

The index at which the new TextRun was added.

Clear()

Removes all elements from the TextRunCollection.

public void Clear()

Contains(TextRun)

Determines whether a specific TextRun object is in the TextRunCollection.

public bool Contains(TextRun run)

Parameters

run TextRun

The TextRun to locate in the TextRunCollection.

Returns

bool

true if the TextRun is found in the TextRunCollection; otherwise, false.

CopyTo(Array, int)

public void CopyTo(Array array, int index)

Parameters

array Array
index int

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator GetEnumerator()

Returns

IEnumerator

An enumerator that iterates over the collection.

IndexOf(TextRun)

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

public int IndexOf(TextRun run)

Parameters

run TextRun

The TextRun to locate in the TextRunCollection.

Returns

int

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

Insert(int, TextRun)

Inserts a TextRun object into the TextRunCollection at the specified index.

public void Insert(int index, TextRun run)

Parameters

index int

The zero-based index at which the TextRun should be inserted.

run TextRun

The TextRun to insert.

Remove(TextRun)

Removes the specified TextRun object from the TextRunCollection.

public void Remove(TextRun run)

Parameters

run TextRun

The TextRun to remove.

RemoveAt(int)

Removes the TextRun object at the specified index from the TextRunCollection.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the TextRun to remove.