Specifies the contextual information about an application thread.
Protected Member Functions | |
| virtual void | exit_thread_core () |
| Terminates the message loop of the thread. | |
| virtual void | on_main_form_closed (object &sender, const event_args &e) |
| Calls ExitThreadCore(), which raises the ThreadExit event. | |
Public Events | |
| event< application_context, event_handler > | thread_exit |
| Occurs when the message loop of the thread should be terminated, by calling exit_thread(). | |
Public Constructors | |
| application_context () | |
| Initializes a new instance of the application_context class with no context. | |
| application_context (const form &main_form) noexcept | |
| Initializes a new instance of the application_context class with the specified Form. | |
Public Properties | |
| std::optional< const_form_ref > | main_form () const noexcept |
| Gets the form to use as context. | |
| std::optional< form_ref > | main_form () noexcept |
| Gets or sets the Form to use as context. | |
| void | main_form (const form &main_form) |
| Sets the Form to use as context. | |
| void | main_form (std::nullptr_t) |
| Resets the Form to use as context. | |
| xtd::any_object | tag () const noexcept |
| Gets an object that contains data about the control. | |
| void | tag (const xtd::any_object &tag) |
| Sets an object that contains data about the control. | |
Public Methods | |
| void | exit_thread () |
| Terminates the message loop of the thread. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | equals (const object &obj) const noexcept -> bool |
| Determines whether the specified object is equal to the current 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 | to_string () const -> xtd::string |
| Returns a xtd::string that represents the current object. | |
| 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. | |
| xtd::forms::application_context::application_context | ( | ) |
Initializes a new instance of the application_context class with no context.
|
explicitnoexcept |
Initializes a new instance of the application_context class with the specified Form.
| main_form | The main form of the application to use for context. |
|
noexcept |
Gets the form to use as context.
|
noexcept |
Gets or sets the Form to use as context.
| void xtd::forms::application_context::main_form | ( | const form & | main_form | ) |
Sets the Form to use as context.
| main_form | The form to use as context. |
| void xtd::forms::application_context::main_form | ( | std::nullptr_t | ) |
Resets the Form to use as context.
| nullptr |
|
noexcept |
Gets an object that contains data about the control.
| void xtd::forms::application_context::tag | ( | const xtd::any_object & | tag | ) |
Sets an object that contains data about the control.
| tag | A xtd::any_object that contains data about the control. The default is empty. |
| void xtd::forms::application_context::exit_thread | ( | ) |
Terminates the message loop of the thread.
|
protectedvirtual |
Terminates the message loop of the thread.
|
protectedvirtual |
Calls ExitThreadCore(), which raises the ThreadExit event.
| sender | The object that raised the event. |
| e | The event_args that contains the event data. |
| event<application_context, event_handler> xtd::forms::application_context::thread_exit |
Occurs when the message loop of the thread should be terminated, by calling exit_thread().