xtd 0.2.0
Loading...
Searching...
No Matches
form_collection.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "form.hpp"
6#include <xtd/ref>
7#include <xtd/collections/generic/list>
8
10namespace xtd {
12 namespace forms {
24 class form_collection : public xtd::collections::generic::list<xtd::ref<form>> {
25 public:
27
32
34
38 explicit form_collection() = default;
40
43 form_collection(const form_collection& collection) = default;
44 auto operator =(form_collection&& collection) -> form_collection& = default;
45 auto operator =(const form_collection& collection) -> form_collection& = default;
47
49
51 using base_type::operator [];
56 auto operator [](const xtd::string& name) const -> value_type {
57 for (auto item : self_)
58 if (item.get().name() == name) return item;
59 return {};
60 }
61
65 auto operator [](const xtd::string& name) -> value_type {
66 for (auto item : self_)
67 if (item.get().name() == name) return item;
68 return {};
69 }
70
71 };
72 }
73}
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:80
typename ilist< xtd::ref< form > >::value_type value_type
Definition list.hpp:86
auto operator=(const list &other) -> list &=default
xtd::collections::generic::list< xtd::ref< form > > base_type
Represents the base type of the collection.
Definition form_collection.hpp:30
auto operator[](const xtd::string &name) const -> value_type
Gets the first xtd::forms::form_collection in the list with the specified name.
Definition form_collection.hpp:56
form_collection()=default
Creates a new object xtd::forms::form_collection with specified allocator (optional).
Contains xtd::forms::form container.
#define self_
The self_ expression is a reference value expression whose value is the reference of the implicit obj...
Definition self.hpp:20
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8