xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::form_collection Class Reference
Inheritance diagram for xtd::forms::form_collection:
xtd::collections::generic::list< xtd::ref< form > > xtd::object xtd::iequatable< type_t > xtd::interface xtd::extensions::equality_operators< type_t, iequatable< type_t > >

Definition

Represents a collection of form objects.

Header
#include <xtd/forms/form_collection>
Namespace
xtd::forms
Library
xtd.forms
Remarks
form_collection is used by the application object to list the currently open forms in an application through the open_forms property.

Public Aliases

using base_type
 Represents the base type of the collection.

Public Constructors

 form_collection ()=default
 Creates a new object xtd::forms::form_collection with specified allocator (optional).

Operators

auto operator[] (const xtd::string &name) const -> value_type
 Gets the first xtd::forms::form_collection in the list with the specified name.
auto operator[] (const xtd::string &name) -> value_type
 Gets the first xtd::forms::form_collection in the list with the specified name.

Additional Inherited Members

using value_type
 Represents the list value type.
using base_type
 Represents the list base type.
using const_base_type
 Represents the list base type.
using size_type
 Represents the list size type (usually xtd::size).
using reference
 Represents the reference of list value type.
using const_reference
 Represents the const reference of list value type.
using pointer
 Represents the pointer of list value type.
using const_pointer
 Represents the const pointer of list value type.
using read_only_collection
 Represents the read only collection of of list.
 list () noexcept=default
 Initializes a new instance of the xtd::collections::generic::list class that is empty.
 list (size_type capacity)
 Constructs the container with specified count default-inserted instances of type_t. No copies are made.
 list (const xtd::collections::generic::ienumerable< xtd::ref< form > > &collection)
 Initializes a new instance of the xtd::collections::generic::list <type_t> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
 list (const list &list)
 Default copy constructor with specified list.
 list (list &&list)
 Move constructor with specified list.
 list (const base_type &list)
 Copy constructor with specified base type list.
 list (base_type &&list)
 Move constructor with specified base type list.
 list (std::initializer_list< xtd::ref< form > > items)
 Constructs the container with the contents of the specified initializer list, and allocator.
 list (input_iterator_t first, input_iterator_t last)
 Constructs the container with the contents of the range [first, last).
auto capacity () const noexcept -> size_type
 Gets the total number of elements the internal data structure can hold without resizing.
auto capacity (size_type value) -> void
 Sets the total number of elements the internal data structure can hold without resizing.
auto count () const noexcept -> size_type override
 Gets the number of elements contained in the xtd::collections::generic::list <type_t>.
auto data () noexcept -> pointer
 Returns pointer to the underlying array serving as element storage.
auto data () const noexcept -> const_pointer
 Returns pointer to the underlying array serving as element storage.
const auto & items () const noexcept
 Returns the underlying base type items.
auto & items () noexcept
 Returns the underlying base type items.
auto add (const xtd::ref< form > &item) -> void override
 Adds an object to the end of the xtd::collections::generic::list <type_t>.
auto add (xtd::ref< form > &&item) -> void
 Adds an object to the end of the xtd::collections::generic::list <type_t>.
auto add_range (const xtd::collections::generic::ienumerable< xtd::ref< form > > &enumerable) -> void
 Adds copy of elements from the specified collection to the end of the xtd::collections::generic::list <type_t>.
auto add_range (std::initializer_list< xtd::ref< form > > il) -> void
 Adds copy of elements from the specified collection to the end of the xtd::collections::generic::list <type_t>.
auto as_read_only () const noexcept -> read_only_collection
 Returns a read-only xtd::collections::object_model::read_only_collection <type_t> wrapper for the current collection.
auto binary_search (const xtd::ref< form > &item) const noexcept -> xtd::size
 Searches the entire sorted xtd::collections::generic::list <type_t> for an element using the default comparer and returns the zero-based index of the element.
auto binary_search (const xtd::ref< form > &item, const xtd::collections::generic::icomparer< xtd::ref< form > > &comparer) const noexcept -> xtd::size
 Searches the entire sorted xtd::collections::generic::list <type_t> for an element using the specified comparer and returns the zero-based index of the element.
auto binary_search (xtd::size index, xtd::size count, const xtd::ref< form > &item, const xtd::collections::generic::icomparer< xtd::ref< form > > &comparer) const -> xtd::size
 Searches a range of elements in the sorted xtd::collections::generic::list <type_t> for an element using the specified comparer and returns the zero-based index of the element.
auto clear () -> void override
 Removes all elements from the xtd::collections::generic::list <type_t>.
auto contains (const xtd::ref< form > &value) const noexcept -> bool override
 Determines whether an element is in the xtd::colllections::generic::list <type_t>.
auto convert_all (converter_t converter) const -> list< output_t >
 Converts the elements in the current xtd::colllections::generic::list <type_t> to another type, and returns a list containing the converted elements.
auto copy_to (xtd::array< xtd::ref< form > > &array) const -> void
 Copies the entire xtd::collections::generic::list <type_t> to a compatible one-dimensional array.
auto copy_to (xtd::array< xtd::ref< form > > &array, size_type array_index) const -> void override
 Copies the entire xtd::colllections::generic::list <type_t> to a compatible one-dimensional array, starting at the specified index of the target array.
auto copy_to (size_type index, xtd::array< xtd::ref< form > > &array, size_type array_index, size_type count) const -> void
 Copies the entire xtd::collections::generic::list <type_t> to a compatible one-dimensional array, starting at the specified index of the target array.
auto ensure_capacity (xtd::size capacity) -> xtd::size
 Ensures that the capacity of this list is at least the specified capacity. If the current capacity is less than capacity, it is increased to at least the specified capacity.
auto equals (const object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto equals (const list &obj) const noexcept -> bool override
 Indicates whether the current object is equal to another object of the same type.
auto exists (predicate_t match) const -> bool
 Determines whether the xtd::collections::generic::list <type_t> contains elements that match the conditions defined by the specified predicate.
auto find (predicate_t match) const -> optional< xtd::ref< form > >
 Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire xtd::collections::generic::list <type_t>.
auto find_all (predicate_t match) const -> list
 Retrieves all the elements that match the conditions defined by the specified predicate.
auto find_index (predicate_t match) const -> xtd::size
 Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire xtd::collections::generic::list <type_t>.
auto find_index (xtd::size start_index, predicate_t match) const -> xtd::size
 Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the xtd::collections::generic::list <type_t> that extends from the specified index to the last element.
auto find_index (xtd::size start_index, xtd::size count, predicate_t match) const -> xtd::size
 Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the xtd::collections::generic::list <type_t> that starts at the specified index and contains the specified number of elements.
auto find_last (predicate_t match) const -> optional< xtd::ref< form > >
 Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire xtd::collections::generic::list <type_t>.
auto find_last_index (predicate_t match) const -> xtd::size
 Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire xtd::collections::generic::list <type_t>.
auto find_last_index (xtd::size start_index, predicate_t match) const -> xtd::size
 Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the xtd::collections::generic::list <type_t> that extends from the first element to the specified index.
auto find_last_index (xtd::size start_index, xtd::size count, predicate_t match) const -> xtd::size
 Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the xtd::collections::generic::list <type_t> that contains the specified number of elements and ends at the specified index.
auto for_each (action_t action) -> void
 Performs the specified action on each element of the xtd::collections::generic::list <type_t>.
enumerator< value_typeget_enumerator () const noexcept override
 Returns an enumerator that iterates through the xtd::collections::generic::list <type_t>.
auto get_range (size_type index, size_type count) -> list
 Creates a shallow copy of a range of elements in the source xtd::collections::generic::list <type_t>.
auto index_of (const xtd::ref< form > &value) const noexcept -> size_type override
 Determines the index of a specific item in the xtd::collections::generic::list <type_t>.
auto index_of (const xtd::ref< form > &value, size_type index) const -> size_type
 Determines the index of a specific item in the xtd::collections::generic::list <type_t>.
auto insert (size_type index, const xtd::ref< form > &value) -> void override
 Determines the index of a specific item in the xtd::collections::generic::list <type_t>.
auto insert (size_type index, xtd::ref< form > &&value) -> void
 Inserts an element into the xtd::collections::generic::list <type_t> at the specified index.
auto insert_range (size_type index, const xtd::collections::generic::ienumerable< xtd::ref< form > > &enumerable) -> void
 Inserts copy of elements from a collection into the xtd::collections::generic::list <type_t> at the specified index.
auto insert_range (size_type index, const std::initializer_list< xtd::ref< form > > &items) -> void
 Inserts copy of elements from a collection into the xtd::collections::generic::list <type_t> at the specified index.
auto last_index_of (const xtd::ref< form > &value) const noexcept -> size_type
 Determines the last index of a specific item in the xtd::collections::generic::list <type_t>.
auto last_index_of (const xtd::ref< form > &value, size_type index, size_type count) const -> size_type
 Determines the last index of a specific item in the xtd::collections::generic::list <type_t>.
auto remove (const xtd::ref< form > &item) noexcept -> bool override
 Removes the first occurrence of a specific object from the xtd::collections::generic::list <type_t>.
auto remove_all (predicate_t match) -> xtd::size
 Removes all the elements that match the conditions defined by the specified predicate.
auto remove_at (size_type index) -> void override
 Removes the element at the specified index of the xtd::collections::generic::list <type_t>.
auto remove_range (size_type index, size_type count) -> void
 Removes a range of elements from the xtd::collections::generic::list <type_t>.
auto reverse () -> list< xtd::ref< form > > &
 Resizes the container to contain count elements, does nothing if count == size(). @param count The new size of the container. @exception xtd::argument_out_of_range_exception xtd::collections::generic::list::capacity is set to a value that is less than xtd::collections::generic::list::count. @remarks If the current size is greater than count, the container is reduced to its first count elements. @remarks If the current size is less than count, additional default-inserted elements are appended. */ virtual auto resize(size_type count) -> void {resize(count, value_type {});} /** @brief Resizes the container to contain count elements, does nothing if count == size().
auto reverse (size_type index, size_type count) -> list< xtd::ref< form > > &
 Reverses the order of the elements in the specified range.
auto slice (size_type start, size_type length) const -> list< xtd::ref< form > >
 Creates a shallow copy of a range of elements in the source xtd::collections::generic::list <type_t>.
auto sort () -> list< xtd::ref< form > > &
 Sorts the elements in the entire xtd::collections::generic::list <type_t> using the default comparer.
auto sort (xtd::comparison< const xtd::ref< form > & > comparison) -> list< xtd::ref< form > > &
 Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified xtd::comparison <type_t>.
auto sort (const xtd::collections::generic::icomparer< xtd::ref< form > > &comparer) -> list< xtd::ref< form > > &
 Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified comparer.
auto sort (xtd::size index, xtd::size count, const xtd::collections::generic::icomparer< xtd::ref< form > > &comparer) -> list< xtd::ref< form > > &
 Sorts the elements in a range of elements in xtd::collections::generic::list <type_t> using the specified comparer.
auto to_array () const noexcept -> xtd::array< value_type >
 Copies the elements of the xtd::collections::generic::list <type_t> to a new array.
auto to_string () const noexcept -> xtd::string override
 Returns a xtd::string that represents the current object.
auto trim_excess () -> void
 Sets the capacity to the actual number of elements in the xtd::collections::generic::list <type_t>, if that number is less than a threshold value.
auto true_for_all (prediacate_t match) const -> bool
 Determines whether every element in the xtd::collections::generic::list <type_t> matches the conditions defined by the specified predicate.
auto operator= (const list &other) -> list &=default
 Copy assignment operator. Replaces the contents with a copy of the contents of other.
auto operator= (list &&other) noexcept -> list &
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards.
auto operator= (const std::initializer_list< xtd::ref< form > > &items) -> list &
 Replaces the contents with those identified by initializer list ilist.
auto operator[] (size_type index) const -> const_reference override
 Returns a reference to the element at specified location index.
auto operator[] (size_type index) -> reference override
 Returns a reference to the element at specified location index.
 operator const_base_type & () const noexcept
 Returns a reference to the underlying base type.
 operator base_type & () noexcept
 Returns a reference to the underlying base type.
 object ()=default
 Create a new instance of the ultimate base class object.
virtual xtd::size get_hash_code () const noexcept
 Serves as a hash function for a particular type.
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
template<class object_t>
xtd::unique_ptr_object< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
virtual bool equals (const type_t &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
template<class object_a_t, class object_b_t>
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
template<class object_a_t, class object_b_t>
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.

Member Typedef Documentation

◆ base_type

Represents the base type of the collection.

Constructor & Destructor Documentation

◆ form_collection()

xtd::forms::form_collection::form_collection ( )
explicitdefault

Creates a new object xtd::forms::form_collection with specified allocator (optional).

Remarks
If allocator not specified, the std::allocator<value_type> is used.

Member Function Documentation

◆ operator[]() [1/2]

auto xtd::forms::form_collection::operator[] ( const xtd::string & name) const -> value_type
inline

Gets the first xtd::forms::form_collection in the list with the specified name.

Parameters
nameThe name of the xtd::forms::control to get from the list.
Returns
The first xtd::forms::control in the list with the given Name. This item returns optional with no value if no xtd::forms::control with the given name can be found.
Remarks
The operator [] property is case-sensitive when searching for names. That is, if two controls exist with the names "Lname" and "lname", operator [] property will find only the xtd::forms::control with the xtd::forms::control::name() that you specify, not both.

◆ operator[]() [2/2]

auto xtd::forms::form_collection::operator[] ( const xtd::string & name) -> value_type
inline

Gets the first xtd::forms::form_collection in the list with the specified name.

Parameters
nameThe name of the xtd::forms::control to get from the list.
Returns
The first xtd::forms::control in the list with the given Name. This item returns optional with no value if no xtd::forms::control with the given name can be found.
Remarks
The operator [] property is case-sensitive when searching for names. That is, if two controls exist with the names "Lname" and "lname", operator [] property will find only the xtd::forms::control with the xtd::forms::control::name() that you specify, not both.

The documentation for this class was generated from the following file: