xtd 0.2.0
Loading...
Searching...
No Matches
application_context.h
Go to the documentation of this file.
1
4#pragma once
5#include "form.h"
6#include <xtd/object>
7
9namespace xtd {
11 namespace forms {
24 class application_context : public object {
25 struct data;
26
27 public:
29
36 explicit application_context(const form& main_form) noexcept;
38
44
46
51 std::optional<const_form_ref> main_form() const noexcept;
55 std::optional<form_ref> main_form() noexcept;
59 void main_form(const form& main_form);
63 void main_form(std::nullptr_t);
64
69 std::any tag() const noexcept;
74 void tag(std::any tag);
76
78
85
87
93
94 protected:
98 virtual void exit_thread_core();
99
104 virtual void on_main_form_closed(object& sender, const event_args& e);
105
106 private:
107 std::shared_ptr<data> data_;
108 };
109 }
110}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents an event.
Definition event.h:21
Specifies the contextual information about an application thread.
Definition application_context.h:24
std::any tag() const noexcept
Gets an object that contains data about the control.
event< application_context, event_handler > thread_exit
Occurs when the message loop of the thread should be terminated, by calling exit_thread().
Definition application_context.h:91
void exit_thread()
Terminates the message loop of the thread.
virtual void exit_thread_core()
Terminates the message loop of the thread.
std::optional< const_form_ref > main_form() const noexcept
Gets the form to use as context.
application_context()
Initializes a new instance of the application_context class with no context.
virtual void on_main_form_closed(object &sender, const event_args &e)
Calls ExitThreadCore(), which raises the ThreadExit event.
application_context(const form &main_form) noexcept
Initializes a new instance of the application_context class with the specified Form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:52
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
@ any
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
std::reference_wrapper< form > form_ref
Represent an xtd::forms::form reference.
Definition form_ref.h:23
@ e
The E key.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::style_sheets::form alias.