xtd 0.2.0
Loading...
Searching...
No Matches
switch_object.hpp
Go to the documentation of this file.
1
4#pragma once
5#include <cstdint>
7#include "../array.hpp"
8#include "../iequatable.hpp"
9#include "../object.hpp"
10#include "../string.hpp"
11#include "source_levels.hpp"
12
14namespace xtd {
16 namespace diagnostics {
36 class core_export_ switch_object : public xtd::object, public xtd::iequatable<xtd::diagnostics::switch_object> {
37 public:
40 auto operator =(const xtd::diagnostics::switch_object& value) -> switch_object& = default;
42
44
48
50
52
56 [[nodiscard]] auto attributes() const noexcept -> const attribute_collection&;
59 [[nodiscard]] auto attributes() noexcept -> attribute_collection&;
62 auto attributes(const attribute_collection& attributes) noexcept -> void;
63
67 [[nodiscard]] auto description() const noexcept -> const xtd::string&;
68
72 [[nodiscard]] auto display_name() const noexcept -> const xtd::string&;
73
79 [[nodiscard]] auto value() const noexcept -> const xtd::string&;
85 auto value(const xtd::string& value) -> void;
87
89
94 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
98 [[nodiscard]] auto equals(const switch_object& other) const noexcept -> bool override;
100
101 protected:
103
111 switch_object(const xtd::string& display_name, const xtd::string& description);
113
115
119 [[nodiscard]] auto switch_setting() const noexcept -> xtd::int32;
124
126
133 [[nodiscard]] virtual auto get_supported_attributes() const noexcept -> xtd::array<xtd::string>;
134
136 virtual auto on_switch_setting_changed() -> void;
137
142 virtual auto on_value_changed() -> void;
144
145 private:
146 xtd::string display_name_;
147 xtd::string description_;
148 attribute_collection attributes_;
149 xtd::int32 switch_setting_ = 0;
150 xtd::string value_ = "0";
151 inline static xtd::collections::specialized::string_dictionary switches_;
152 };
153 }
154}
Contains xtd::array class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Provides an abstract base class to create new debugging and tracing switches.
Definition switch_object.hpp:36
auto attributes() const noexcept -> const attribute_collection &
Gets the custom switch attributes.
virtual auto get_supported_attributes() const noexcept -> xtd::array< xtd::string >
Gets the custom attributes supported by the switch.
virtual auto on_value_changed() -> void
Invoked when the value property is changed.
auto description() const noexcept -> const xtd::string &
Gets a description of the switch.
switch_object(const xtd::string &display_name, const xtd::string &description)
Initializes a new instance of the switch_object class.
auto switch_setting() const noexcept -> xtd::int32
Gets the current setting for this switch.
xtd::collections::specialized::string_dictionary attribute_collection
Represents the attributes collection.
Definition switch_object.hpp:47
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
virtual auto on_switch_setting_changed() -> void
Invoked when the switch_setting property is changed.
auto display_name() const noexcept -> const xtd::string &
Gets a name used to identify the switch.
auto value() const noexcept -> const xtd::string &
Gets the value of the switch.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::collections::generic::dictionary< xtd::string, xtd::string > string_dictionary
Represents a xtd::collections::generic::dictionary with the key and the value strongly typed to be st...
Definition string_dictionary.hpp:28
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:60
Contains xtd::iequatable interface.
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Contains xtd::diagnostics::source_levels enum class.
Contains xtd::string alias.
Contains xtd::collections::specialized::string_dictionary alias.