xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::form_collection Class Reference
Inheritance diagram for xtd::forms::form_collection:
xtd::collections::generic::list< xtd::ref< xtd::forms::form > > xtd::object xtd::collections::generic::ilist< type_t > xtd::iequatable< type_t > xtd::collections::generic::icollection< type_t > xtd::interface xtd::extensions::equality_operators< type_t, iequatable< type_t > > xtd::collections::generic::ienumerable< type_t > xtd::collections::generic::extensions::collection_common< type_t, icollection< type_t > > xtd::interface xtd::collections::generic::ienumerable_abstract xtd::collections::generic::extensions::enumerable_iterators< type_t, xtd::collections::generic::ienumerable< type_t > > xtd::collections::generic::extensions::enumerable< ienumerable< type_t >, 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::usize).
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.
using value_type
 Represents the xtd::collections::generic::icollection value type.
using value_type
 Represents the xtd::collections::generic::ienumerable value type.
using iterator
 Represents the iterator of xtd::collections::generic::ienumerable value type.
using const_iterator
 Represents the const iterator of xtd::collections::generic::ienumerable value type.
using iterator
 Represents the iterator of enumerable value type.
using const_iterator
 Represents the const iterator of enumerable value type.
using enumerable_type
 Represents the ienumerable enumerable type.
using source_type
 Represents the ienumerable source type.
using ienumerable
 Represents the ienumerable value type.
using list
 Represents the list value type.
static constexpr xtd::usize npos
 Represents a value that is not a valid position in a collection.
static constexpr xtd::usize bpos
 Represents the index of the first valid element in a collection.
static constexpr xtd::usize epos
 Represents the index of the last valid element in a collection.
 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< xtd::forms::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< xtd::forms::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< xtd::forms::form > &item) -> void override
 Adds an object to the end of the xtd::collections::generic::list <type_t>.
auto add (xtd::ref< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::form > &item) const noexcept -> xtd::usize
 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< xtd::forms::form > &item, const xtd::collections::generic::icomparer< xtd::ref< xtd::forms::form > > &comparer) const noexcept -> xtd::usize
 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::usize index, xtd::usize count, const xtd::ref< xtd::forms::form > &item, const xtd::collections::generic::icomparer< xtd::ref< xtd::forms::form > > &comparer) const -> xtd::usize
 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< xtd::forms::form > &value) const noexcept -> bool override
 Determines whether an element is in the xtd::colllections::generic::list <type_t>.
auto convert_all (converter_t converterconverter) 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< xtd::forms::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< xtd::forms::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< xtd::forms::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::usize capacity) -> xtd::usize
 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< xtd::forms::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::usize
 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::usize start_index, predicate_t match) const -> xtd::usize
 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::usize start_index, xtd::usize count, predicate_t match) const -> xtd::usize
 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< xtd::forms::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::usize
 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::usize start_index, predicate_t match) const -> xtd::usize
 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::usize start_index, xtd::usize count, predicate_t match) const -> xtd::usize
 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< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::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< xtd::forms::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::usize
 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< xtd::forms::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< xtd::forms::form > > &
 Reverses the order of the elements in the specified range.
auto slice (size_type start, size_type length) const -> list< xtd::ref< xtd::forms::form > >
 Creates a shallow copy of a range of elements in the source xtd::collections::generic::list <type_t>.
auto sort () -> list< xtd::ref< xtd::forms::form > > &
 Sorts the elements in the entire xtd::collections::generic::list <type_t> using the default comparer.
auto sort (xtd::comparison< const xtd::ref< xtd::forms::form > & > comparisoncomparison) -> list< xtd::ref< xtd::forms::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< xtd::forms::form > > &comparer) -> list< xtd::ref< xtd::forms::form > > &
 Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified comparer.
auto sort (xtd::usize index, xtd::usize count, const xtd::collections::generic::icomparer< xtd::ref< xtd::forms::form > > &comparer) -> list< xtd::ref< xtd::forms::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< xtd::forms::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 auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto add (const type_t &item) -> void=0
 Adds an item to the xtd::collections::generic::icollection <type_t>.
virtual auto contains (const type_t &item) const noexcept -> bool=0
 Determines whether the xtd::collections::generic::icollection <type_t> contains a specific value.
virtual auto copy_to (xtd::array< type_t > &array, xtd::usize array_index) const -> void=0
 Copies the elements of the xtd::collections::generic::icollection <type_t> to an xtd::array, starting at a particular xtd::array index.
virtual auto index_of (const type_t &item) const noexcept -> xtd::usize=0
 Determines the index of a specific item in the xtd::collections::generic::ilist <type_t>.
virtual auto insert (xtd::usize index, const type_t &item) -> void=0
 Inserts an item to the xtd::collections::generic::ilist <type_t> at the specified index.
virtual auto remove (const type_t &item) -> bool=0
 Removes the first occurrence of a specific object from the xtd::collections::generic::icollection <type_t>.
virtual auto begin () const -> const_iterator
 Returns an iterator to the first element of the enumerable.
virtual auto cbegin () const -> const_iterator
 Returns an iterator to the first element of the enumerable.
virtual auto cend () const -> const_iterator
 Returns an iterator to the element following the last element of the enumerable.
virtual auto end () const -> const_iterator
 Returns an iterator to the element following the last element of the enumerable.
auto aggregate (const std::function< type_t(const type_t &, const type_t &)> &funcfunc) const -> type_t
 Applies an accumulator function over a sequence.
auto all (const std::function< bool(const type_t &)> &predicatepredicate) const -> bool
 Determines whether all elements of a sequence satisfy a condition.
auto any () const noexcept -> bool
 Determines whether a sequence contains any elements.
auto append (const type_t &element) const noexcept
 Appends a value to the end of the sequence.
auto as_enumerable () const noexcept
 Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
auto average () const noexcept
 Computes the average of a sequence of source_t values.
auto cast () const noexcept
 Casts the elements of an xtd::collections::generic::ienumerable to the specified type.
auto chunk (xtd::usize size) const
 Splits the elements of a sequence into chunks of size at most size.
auto concat (const ienumerable< type_t > &second) const noexcept
 Concatenates two sequences.
auto contains (const type_t &value) const noexcept -> bool
 Determines whether a sequence contains a specified element by using the default equality comparer.
auto count () const noexcept -> xtd::usize
 Returns the number of elements in current sequence.
auto count_by (const std::function< key_t(const type_t &)> &key_selector) const noexcept
 Returns the count of elements in the current sequence grouped by key.
auto default_if_empty () const noexcept
 Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the current sequence is empty.
auto distinct () const noexcept
 Returns distinct elements from a sequence by using the default equality comparer to compare values.
auto first_or_default (const std::function< bool(const type_t &)> &predicatepredicate, const type_t &default_value) const noexcept -> type_t
 Returns the first element of the sequence that satisfies a condition, or a specified default value if no such element is found.
auto order () const
 Sorts the elements of a sequence in ascending order.
auto order_by (const std::function< type_t(const type_t &)> &key_selector) const
 Sorts the elements of a sequence in ascending order according to a key.
auto order_by_descending (const std::function< key_t(const type_t &)> &key_selector) const
 Sorts the elements of a sequence in descending order according to a key.
auto select (auto &&selector) const
 Projects each element of a sequence into a new form.
auto to_array () const noexcept -> xtd::array< type_t >
 Creates a xtd::array <type_t> from an xtd::collections::generic::ienumerable <type_t>.
auto to_list () const noexcept -> xtd::collections::generic::list< type_t >
 Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <type_t>.
auto where (auto &&predicatepredicate) const
 Filters a sequence of values based on a predicate.
virtual auto empty () const noexcept -> bool
 Checks whether the container is empty.
virtual auto size () const noexcept -> xtd::usize
 Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>.
virtual auto operator<< (const type_t &item) -> icollection< type_t > &
 The shift left operator adds an item to the xtd::collections::generic::icollection <type_t>.
virtual auto operator>> (const type_t &item) -> icollection< type_t > &
 The shift right operator removes the first occurrence of a specific object from the xtd::collections::generic::icollection <type_t>.
virtual auto equals (const type_t &) const noexcept -> bool=0
 Indicates whether the current object is equal to another object of the same type.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.
static auto to_const_iterator (typename source_collection_t::const_iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept -> typename target_collection_t::const_iterator
 Converts source iterator to target iterator.
static auto to_iterator (typename source_collection_t::const_iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept -> typename target_collection_t::const_iterator
 Converts source iterator to target iterator.

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
inlinenodiscard

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
inlinenodiscard

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: