Provides a simple on/off switch that controls debugging and tracing output.
Public Constructors | |
| boolean_switch (const xtd::string &display_name, const xtd::string &description) | |
| Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display name and description. | |
| boolean_switch (const xtd::string &display_name, const xtd::string &description, const xtd::string &default_switch_value) | |
| Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display name, description, and default switch value. | |
Public Properties | |
| auto | enabled () const -> bool |
| Gets a value indicating whether the switch is enabled or disabled. | |
| auto | enabled (bool enabled) -> void |
| Sets a value indicating whether the switch is enabled or disabled. | |
Protected Methods | |
| auto | on_value_changed () -> void override |
| Determines whether the new value of the Value property can be parsed as a Boolean value. | |
Additional Inherited Members | |
| using | attribute_collection |
| Represents the attributes collection. | |
| auto | attributes () const noexcept -> const attribute_collection & |
| Gets the custom switch attributes. | |
| auto | attributes () noexcept -> attribute_collection & |
| Gets the custom switch attributes. | |
| auto | attributes (const attribute_collection &attributes) noexcept -> void |
| Sets the custom switch attributes. | |
| auto | description () const noexcept -> const xtd::string & |
| Gets a description of the switch. | |
| 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. | |
| auto | value (const xtd::string &value) -> void |
| Sets the value of the switch. | |
| auto | equals (const xtd::object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const switch_object &other) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| 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 xtd::string | to_string () const |
| Returns a xtd::string that represents the current object. | |
| 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. | |
| 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. | |
| auto | switch_setting (xtd::int32 switch_setting) -> void |
| Sets the current setting for this switch. | |
| virtual auto | get_supported_attributes () const noexcept -> xtd::array< xtd::string > |
| Gets the custom attributes supported by the switch. | |
| virtual auto | on_switch_setting_changed () -> void |
| Invoked when the switch_setting property is changed. | |
| xtd::diagnostics::boolean_switch::boolean_switch | ( | const xtd::string & | display_name, |
| const xtd::string & | description ) |
Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display name and description.
| display_name | The name to display on a user interface. |
| description | The description of the switch. |
| xtd::diagnostics::boolean_switch::boolean_switch | ( | const xtd::string & | display_name, |
| const xtd::string & | description, | ||
| const xtd::string & | default_switch_value ) |
Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display name, description, and default switch value.
| display_name | The name to display on a user interface. |
| description | The description of the switch. |
| default_switch_value | The default value of the switch. |
|
nodiscard |
Gets a value indicating whether the switch is enabled or disabled.
| auto xtd::diagnostics::boolean_switch::enabled | ( | bool | enabled | ) | -> void |
Sets a value indicating whether the switch is enabled or disabled.
| enabled | true if the switch is enabled; otherwise, false. The default is false. |
|
overrideprotectedvirtual |
Determines whether the new value of the Value property can be parsed as a Boolean value.
Reimplemented from xtd::diagnostics::switch_object.