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 {
26 class application_context : public object {
27 struct data;
28
29 public:
31
38 explicit application_context(const form& main_form) noexcept;
40
46
48
53 std::optional<const_form_ref> main_form() const noexcept;
57 std::optional<form_ref> main_form() noexcept;
61 void main_form(const form& main_form);
65 void main_form(std::nullptr_t);
66
71 std::any tag() const noexcept;
76 void tag(std::any tag);
78
80
87
89
95
96 protected:
100 virtual void exit_thread_core();
101
106 virtual void on_main_form_closed(object& sender, const event_args& e);
107
108 private:
109 xtd::sptr<data> data_;
110 };
111 }
112}
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:26
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:93
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:54
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
std::optional< type_t > optional
Represents the null_opt alias on std::nullopt_t.
Definition optional.h:181
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
@ 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:25
@ 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.