#include <application_context.h>
Specifies the contextual information about an application thread.
- Namespace
- xtd::forms
- Library
- xtd.forms
- Examples
- The following code example demonstrate the use of application and application_context classes.
#include <xtd/xtd>
int main() {
};
form1.
text(
"Form 1 (Click the client area to set form as the main form)");
};
form2.
text(
"Form 2 (Click the client area to set form as the main form)");
};
form3.
text(
"Form 3 (Click the client area to set form as the main form)");
}
Specifies the contextual information about an application thread.
Definition: application_context.h:26
const form & main_form() const
Gets the form to use as context.
Definition: application_context.h:44
event< control, event_handler > click
Occurs when the control is clicked.
Definition: control.h:1065
- Examples
- application_context.cpp.
Inherits xtd::object.
|
| application_context ()=default |
| Initializes a new instance of the application_context class with no context.
|
|
| application_context (const form &main_form) |
| Initializes a new instance of the application_context class with the specified Form.
|
|
void | exit_thread () |
| Terminates the message loop of the thread.
|
|
form & | main_form () |
| Gets or sets the Form to use as context.
|
|
const form & | main_form () const |
| Gets the form to use as context.
|
|
void | main_form (const form &main_form) |
| Sets the Form to use as context.
|
|
std::any | tag () const |
| Gets an object that contains data about the control.
|
|
void | tag (std::any tag) |
| Sets an object that contains data about the control.
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
template<typename object_t > |
std::unique_ptr< object_t > | memberwise_clone () const |
| Gets the type of the current instance.
|
|
virtual xtd::ustring | to_string () const noexcept |
| Returns a std::string that represents the current object.
|
|
|
static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|
◆ application_context() [1/2]
xtd::forms::application_context::application_context |
( |
| ) |
|
|
default |
◆ application_context() [2/2]
xtd::forms::application_context::application_context |
( |
const form & |
main_form | ) |
|
|
inlineexplicit |
Initializes a new instance of the application_context class with the specified Form.
- Parameters
-
main_form | The main form of the application to use for context. |
◆ exit_thread()
void xtd::forms::application_context::exit_thread |
( |
| ) |
|
|
inline |
Terminates the message loop of the thread.
- Note
- exit_thread and exit_thread_core do not actually cause the thread to terminate. These methods raise the thread_exit event to which the Application object listens. The Application object then terminates the thread.
◆ exit_thread_core()
virtual void xtd::forms::application_context::exit_thread_core |
( |
| ) |
|
|
inlineprotectedvirtual |
Terminates the message loop of the thread.
- Note
- exit_thread and exit_thread_core do not actually cause the thread to terminate. These methods raise the thread_exit event to which the Application object listens. The Application object then terminates the thread.
◆ main_form() [1/3]
form & xtd::forms::application_context::main_form |
( |
| ) |
|
|
inline |
Gets or sets the Form to use as context.
- Returns
- The form to use as context.
◆ main_form() [2/3]
const form & xtd::forms::application_context::main_form |
( |
| ) |
const |
|
inline |
◆ main_form() [3/3]
void xtd::forms::application_context::main_form |
( |
const form & |
main_form | ) |
|
|
inline |
Sets the Form to use as context.
- Parameters
-
main_form | The form to use as context. |
◆ on_main_form_closed()
virtual void xtd::forms::application_context::on_main_form_closed |
( |
object & |
sender, |
|
|
const event_args & |
e |
|
) |
| |
|
inlineprotectedvirtual |
Calls ExitThreadCore(), which raises the ThreadExit event.
- Parameters
-
sender | The object that raised the event. |
e | The event_args that contains the event data. |
◆ tag() [1/2]
std::any xtd::forms::application_context::tag |
( |
| ) |
const |
|
inline |
Gets an object that contains data about the control.
- Returns
- A std::any that contains data about the control. The default is empty.
◆ tag() [2/2]
void xtd::forms::application_context::tag |
( |
std::any |
tag | ) |
|
|
inline |
Sets an object that contains data about the control.
- Parameters
-
tag | A std::any that contains data about the control. The default is empty. |
The documentation for this class was generated from the following file: