Table of Contents

Class Tabs

Namespace
RDCore.Forms.Model
Assembly
RDCore.Forms.dll

A TabStrip's tabs, in their order, as a program reaches them: its Tabs. They are the TabStrip's Tabs, which every change here sets anew, so that its view and its PropertyChanged follow.

public sealed class Tabs : IReadOnlyList<Tab>, IReadOnlyCollection<Tab>, IEnumerable<Tab>, IEnumerable
Inheritance
Tabs
Implements
Inherited Members

Remarks

The TabStrip's Value follows its selected tab as tabs are added and removed, as a MultiPage's follows its page (Pages).

Properties

Count

How many tabs the TabStrip has.

public int Count { get; }

Property Value

int

this[int]

The tab at an index, from 0.

public Tab this[int index] { get; }

Parameters

index int

The tab's index.

Property Value

Tab

The tab.

Exceptions

FormErrorException

No tab has the index: 5, Invalid procedure call or argument.

this[string]

The tab of a name, compared without regard to case.

public Tab this[string name] { get; }

Parameters

name string

The tab's name.

Property Value

Tab

The tab.

Exceptions

FormErrorException

No tab has the name: 5, Invalid procedure call or argument.

SelectedItem

The selected tab, or null when the TabStrip's Value selects none: the TabStrip's SelectedItem.

public Tab? SelectedItem { get; }

Property Value

Tab

TabStrip

The TabStrip whose tabs these are.

public ComponentInstance TabStrip { get; }

Property Value

ComponentInstance

Methods

Add(string?, string?, int?)

Adds a tab, as the TabStrip's Tabs.Add does.

public Tab Add(string? name = null, string? caption = null, int? index = null)

Parameters

name string

The tab's name; null names it Tab and the first number no tab has.

caption string

The tab's caption; null captions it with its name.

index int?

Where among the tabs to add it, from 0; null adds it last.

Returns

Tab

The tab added.

Exceptions

FormErrorException

index is below 0 or past the last tab's, or another tab has the name, compared without regard to case: 5, Invalid procedure call or argument.

Clear()

Removes every tab, as the TabStrip's Tabs.Clear does; the TabStrip then has none selected.

public void Clear()

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Tab> GetEnumerator()

Returns

IEnumerator<Tab>

An enumerator that can be used to iterate through the collection.

IndexOf(string)

The index of the tab of a name, compared without regard to case.

public int IndexOf(string name)

Parameters

name string

The tab's name.

Returns

int

Its index, or -1 when no tab has the name.

Of(ComponentInstance)

The tabs of a TabStrip.

public static Tabs Of(ComponentInstance tabStrip)

Parameters

tabStrip ComponentInstance

The TabStrip.

Returns

Tabs

Its tabs.

Exceptions

ArgumentNullException

tabStrip is null.

ArgumentException

tabStrip is not a TabStrip.

Remove(int)

Removes the tab at an index, as the TabStrip's Tabs.Remove does.

public void Remove(int index)

Parameters

index int

The tab's index.

Exceptions

FormErrorException

No tab has the index: 5, Invalid procedure call or argument.

Remove(string)

Removes the tab of a name, compared without regard to case, as Remove(int) removes one at an index.

public void Remove(string name)

Parameters

name string

The tab's name.

Exceptions

FormErrorException

No tab has the name: 5, Invalid procedure call or argument.

Replace(int, Tab)

Puts a tab in the place of the one at an index: how a program's change to a tab's Caption, Enabled or another of its properties reaches the TabStrip.

public void Replace(int index, Tab tab)

Parameters

index int

The tab's index.

tab Tab

The tab to put there.

Exceptions

ArgumentNullException

tab is null.

FormErrorException

No tab has the index, or another tab has the new one's name, compared without regard to case: 5, Invalid procedure call or argument.