Provides static methods and properties to manage an application, such as methods to start and stop an application, to process Windows messages, and methods to get information about an application. This class cannot be inherited.
Public Static Events | |
static event< application, delegate< void(const event_args &)> > | application_exit |
Occurs when the application is about to shut down. | |
static event< application, delegate< void(const event_args &)> > | enter_thread_modal |
Occurs when the application is about to enter a modal state. | |
static event< application, delegate< void(const event_args &)> > | idle |
Occurs when the application finishes processing and is about to enter the idle state. | |
static event< application, delegate< void(const event_args &)> > | leave_thread_modal |
Occurs when the application is about to leave a modal state. | |
static event< application, delegate< void(const event_args &)> > | thread_exit |
Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an application_exit event. | |
Public Static Properties | |
static bool | allow_quit () noexcept |
Gets a value indicating whether the caller can quit this application. | |
static xtd::forms::application_context & | application_context () |
Gets the application context associate to the application. | |
static bool | button_images () noexcept |
Gets button images are enabled. | |
static void | button_images (bool value) |
Gets button images are enabled. | |
static xtd::string | common_app_data_path () noexcept |
Gets the path for the application data that is shared among all users. | |
static xtd::string | company_name () noexcept |
Gets the company name associated with the application. | |
static bool | dark_mode () noexcept |
Gets a value indicating whether dark mode is enabled for the application. | |
static void | dark_mode (bool value) |
Sets a value indicating whether dark mode is enabled for the application. | |
static bool | dark_mode_enabled () noexcept |
Return true if dark mode is enabled for the application; otherwise return false. | |
static xtd::string | executable_name () noexcept |
Gets the executable name for the executable file that started the application, including the executable extension. | |
static xtd::string | executable_path () noexcept |
Gets the path for the executable file that started the application, including the executable name. | |
static bool | font_size_correction () |
Gets a value indicating whether font size correction is enabled. | |
static void | font_size_correction (bool value) |
Sets a value indicating whether font size correction is enabled. | |
static bool | keep_cloned_controls () noexcept |
Gets a value indicating whether the xtd framework keep cloned control is enabled. | |
static void | keep_cloned_controls (bool value) |
Sets a value indicating whether the xtd framework keep cloned control is enabled. | |
static bool | light_mode () noexcept |
Gets a value indicating whether light mode is enabled for the application. | |
static void | light_mode (bool value) |
Sets a value indicating whether light mode is enabled for the application. | |
static bool | light_mode_enabled () noexcept |
Return true if dark mode is enabled for the application; otherwise return false. | |
static std::optional< form_ref > | main_form () |
Gets the optional main form owned by the application. | |
static bool | menu_images () noexcept |
Gets menu images are enabled. | |
static void | menu_images (bool value) |
Sets menu images ilages are enabled. | |
static bool | message_loop () noexcept |
Gets a value indicating whether a message loop exists on this thread. | |
static const form_collection | open_forms () noexcept |
Gets a collection of open forms owned by the application. | |
static xtd::string | product_name () noexcept |
Gets the product name associated with this application. | |
static xtd::string | product_version () noexcept |
Gets the product version associated with this application. | |
static xtd::string | startup_path () noexcept |
Gets the path for the executable file that started the application, not including the executable name. | |
static const xtd::forms::style_sheets::style_sheet & | style_sheet () noexcept |
Gets current xtd::forms::style_sheets::style_sheet style sheet. | |
static void | style_sheet (const xtd::forms::style_sheets::style_sheet &value) |
Sets current xtd::forms::style_sheets::style_sheet style sheet. | |
static const xtd::forms::style_sheets::style_sheet::style_sheets_t & | style_sheets () noexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheets. | |
static const xtd::forms::style_sheets::style_sheet::style_sheet_names_t & | style_sheet_names () noexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet names. | |
static bool | system_controls () noexcept |
Gets a value indicating whether the system control is enabled. | |
static void | system_controls (bool value) |
Sets a value indicating whether the system control is enabled. | |
static bool | system_font_size () noexcept |
Gets a value indicating whether the system font size is enabled. | |
static void | system_font_size (bool value) |
Sets a value indicating whether the system font size is enabled. | |
static const xtd::forms::style_sheets::style_sheet & | system_style_sheet () noexcept |
Gets system xtd::forms::style_sheets::style_sheet style sheet. | |
static xtd::string | user_app_data_path () noexcept |
Gets the path for the application data of a user. | |
static bool | use_visual_styles () noexcept |
Gets a value that indicates whether visual styles are enabled for the application. | |
static bool | use_wait_cursor () noexcept |
Gets whether the wait cursor is used for all open forms of the application. | |
static void | use_wait_cursor (bool use_wait_cursor) |
Sets whether the wait cursor is used for all open forms of the application. | |
static bool | visual_styles () noexcept |
Gets a value that indicates whether visual styles are enabled for the application. | |
static void | visual_styles (bool value) |
Sets a value that indicates whether visual styles are enabled for the application. | |
Public Static Methods | |
static void | add_message_filter (const imessage_filter &value) |
Adds a message filter to monitor Windows messages as they are routed to their destinations. | |
static void | do_events () |
Processes all Windows messages currently in the message queue. | |
static void | enable_button_images () |
Enables button images for the application. | |
static void | enable_dark_mode () |
Enables dark mode for the application. | |
static void | enable_light_mode () |
Enables light mode for the application. | |
static void | enable_menu_images () |
Enables menu images for the application. | |
static void | enable_visual_styles () |
Enables visual styles for the application. | |
static void | exit () |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. | |
static void | exit (cancel_event_args &e) |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. | |
static void | exit_thread () |
Exits the message loop on the current thread and closes all windows on the thread. | |
static xtd::forms::style_sheets::style_sheet | get_style_sheet_from_name (const xtd::string &name) |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet from specified name. | |
static void | raise_idle (const event_args &e) |
Raises the Idle event. | |
static void | register_message_loop_callback (message_loop_callback callback) |
Registers a callback for checking whether the message loop is running in hosted environments. | |
static void | remove_message_filter (const imessage_filter &value) |
Removes a message filter from the message pump of the application. | |
static void | restart () |
Shuts down the application and starts a new instance immediately. | |
static void | run () |
Begins running a standard application message loop on the current thread, without a form. | |
static void | run (xtd::forms::application_context &context) |
Begins running a standard application message loop on the current thread, with an application_context. | |
static void | run (const form &main_form) |
Begins running a standard application message loop on the current thread, and makes the specified form visible. | |
|
staticnoexcept |
Gets a value indicating whether the caller can quit this application.
|
static |
Gets the application context associate to the application.
|
staticnoexcept |
Gets button images are enabled.
|
static |
Gets button images are enabled.
value | true if button images aree enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Gets the path for the application data that is shared among all users.
|
staticnoexcept |
Gets the company name associated with the application.
|
staticnoexcept |
Gets a value indicating whether dark mode is enabled for the application.
|
static |
Sets a value indicating whether dark mode is enabled for the application.
value | True is dark mode enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Return true if dark mode is enabled for the application; otherwise return false.
|
staticnoexcept |
Gets the executable name for the executable file that started the application, including the executable extension.
|
staticnoexcept |
Gets the path for the executable file that started the application, including the executable name.
|
static |
Gets a value indicating whether font size correction is enabled.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Sets a value indicating whether font size correction is enabled.
value | true if font size correction is enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Gets a value indicating whether the xtd framework keep cloned control is enabled.
|
static |
Sets a value indicating whether the xtd framework keep cloned control is enabled.
value | true if xtd framework keep cloned control is enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Gets a value indicating whether light mode is enabled for the application.
|
static |
Sets a value indicating whether light mode is enabled for the application.
value | True is light mode enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Return true if dark mode is enabled for the application; otherwise return false.
|
static |
Gets the optional main form owned by the application.
|
staticnoexcept |
Gets menu images are enabled.
|
static |
Sets menu images ilages are enabled.
value | true if menu images aree enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Gets a value indicating whether a message loop exists on this thread.
|
staticnoexcept |
Gets a collection of open forms owned by the application.
|
staticnoexcept |
Gets the product name associated with this application.
|
staticnoexcept |
Gets the product version associated with this application.
|
staticnoexcept |
Gets the path for the executable file that started the application, not including the executable name.
|
staticnoexcept |
Gets current xtd::forms::style_sheets::style_sheet style sheet.
|
static |
Sets current xtd::forms::style_sheets::style_sheet style sheet.
value | The current xtd::forms::style_sheets::style_sheet style sheet. |
|
staticnoexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheets.
|
staticnoexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet names.
|
staticnoexcept |
Gets a value indicating whether the system control is enabled.
|
static |
Sets a value indicating whether the system control is enabled.
value | true if system control is enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Gets a value indicating whether the system font size is enabled.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Sets a value indicating whether the system font size is enabled.
value | true if the system font size is enabled; otherwise false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
staticnoexcept |
Gets system xtd::forms::style_sheets::style_sheet style sheet.
|
staticnoexcept |
Gets the path for the application data of a user.
|
staticnoexcept |
Gets a value that indicates whether visual styles are enabled for the application.
|
staticnoexcept |
Gets whether the wait cursor is used for all open forms of the application.
|
static |
Sets whether the wait cursor is used for all open forms of the application.
use_wait_cursor | true is the wait cursor is used for all open forms; otherwise, false. |
|
staticnoexcept |
Gets a value that indicates whether visual styles are enabled for the application.
|
static |
Sets a value that indicates whether visual styles are enabled for the application.
value | true if visual styles are enabled; otherwise, false. |
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Adds a message filter to monitor Windows messages as they are routed to their destinations.
The | implementation of the imessage_filter interface you want to install. |
|
static |
Processes all Windows messages currently in the message queue.
|
static |
Enables button images for the application.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Enables dark mode for the application.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Enables light mode for the application.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Enables menu images for the application.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Enables visual styles for the application.
xtd::invalid_operation_exception | If this method is called after xtd::forms::application::run. |
|
static |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.
|
static |
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.
e | Returns whether any Form within the application cancelled the exit. |
|
static |
Exits the message loop on the current thread and closes all windows on the thread.
|
static |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet from specified name.
xtd::argument_exception | The style sheet name not tvalid. |
|
static |
Raises the Idle event.
e | The event_args objects to pass to the idle event. |
|
static |
Registers a callback for checking whether the message loop is running in hosted environments.
callback | The method to call when Windows Forms needs to check if the hosting environment is still sending messages. |
|
static |
Removes a message filter from the message pump of the application.
value | The implementation of the imessage_filter to remove from the application. |
|
static |
Shuts down the application and starts a new instance immediately.
|
static |
Begins running a standard application message loop on the current thread, without a form.
|
static |
Begins running a standard application message loop on the current thread, with an application_context.
context | An ApplicationContext in which the application is run. |
|
static |
Begins running a standard application message loop on the current thread, and makes the specified form visible.
main_form | A form that represents the form to make visible. |
|
static |
Occurs when the application is about to shut down.
|
static |
Occurs when the application is about to enter a modal state.
|
static |
Occurs when the application finishes processing and is about to enter the idle state.
|
static |
Occurs when the application is about to leave a modal state.
|
static |
Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an application_exit event.