Class Pages
- Namespace
- RDCore.Forms.Model
- Assembly
- RDCore.Forms.dll
A MultiPage's pages, in their order, as a program reaches them: its Pages. A page is a Page
component, placed in the MultiPage, and its index is its place among the MultiPage's Contents.
public sealed class Pages : IReadOnlyList<ComponentInstance>, IReadOnlyCollection<ComponentInstance>, IEnumerable<ComponentInstance>, IEnumerable
- Inheritance
-
Pages
- Implements
- Inherited Members
Remarks
The MultiPage's Value (SelectedIndex) follows its selected page as pages are added and removed:
a page added before it, or one removed before it, moves it along; removing the selected page selects the one that takes its
place, or the last; a MultiPage with no pages has none selected (-1).
Properties
Count
How many pages the MultiPage has.
public int Count { get; }
Property Value
this[int]
The page at an index, from 0.
public ComponentInstance this[int index] { get; }
Parameters
indexintThe page's index.
Property Value
- ComponentInstance
The page.
Exceptions
- FormErrorException
No page has the index: 5, Invalid procedure call or argument.
this[string]
The page of a name, compared without regard to case.
public ComponentInstance this[string name] { get; }
Parameters
namestringThe page's name.
Property Value
- ComponentInstance
The page.
Exceptions
- FormErrorException
No page has the name: 730, Control not found.
MultiPage
The MultiPage whose pages these are.
public ComponentInstance MultiPage { get; }
Property Value
SelectedItem
The selected page, or null when the MultiPage's Value selects none: the MultiPage's SelectedItem.
public ComponentInstance? SelectedItem { get; }
Property Value
Methods
Add(string?, string?, int?)
Adds a page, as the MultiPage's Pages.Add does, and raises the form's ControlAdded.
public ComponentInstance Add(string? name = null, string? caption = null, int? index = null)
Parameters
namestringThe page's name; null names it
Pageand the first number no component of the form has.captionstringThe page's caption; null captions it with its name.
indexint?Where among the pages to add it, from 0; null adds it last.
Returns
- ComponentInstance
The page added.
Exceptions
- FormErrorException
indexis below 0 or past the last page's: 5, Invalid procedure call or argument. Otherwise as AddControl(ComponentClass, string, ComponentInstance?) for the name.
Clear()
Removes every page, as the MultiPage's Pages.Clear does; the MultiPage then has none selected.
public void Clear()
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<ComponentInstance> GetEnumerator()
Returns
- IEnumerator<ComponentInstance>
An enumerator that can be used to iterate through the collection.
IndexOf(ComponentInstance)
A page's index, from 0: its Index.
public int IndexOf(ComponentInstance page)
Parameters
pageComponentInstanceThe page.
Returns
- int
Its index, or -1 when it is not one of these pages.
Of(FormDefinition, ComponentInstance)
The pages of a MultiPage of a form.
public static Pages Of(FormDefinition form, ComponentInstance multiPage)
Parameters
formFormDefinitionThe form the MultiPage is on.
multiPageComponentInstanceThe MultiPage.
Returns
- Pages
Its pages.
Exceptions
- ArgumentNullException
formormultiPageis null.- ArgumentException
multiPageis not a MultiPage ofform.
Remove(int)
Removes the page at an index, with the controls on it, as the MultiPage's Pages.Remove does, and raises the form's
ControlRemoved. A page placed at design time is removed too.
public void Remove(int index)
Parameters
indexintThe page's index.
Exceptions
- FormErrorException
No page has the index: 5, Invalid procedure call or argument.
Remove(string)
Removes the page of a name, compared without regard to case, as Remove(int) removes one at an index.
public void Remove(string name)
Parameters
namestringThe page's name.
Exceptions
- FormErrorException
No page has the name: 730, Control not found.