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, event_handler > | application_exit |
| Occurs when the application is about to shut down. | |
| static event< application, event_handler > | enter_thread_modal |
| Occurs when the application is about to enter a modal state. | |
| static event< application, event_handler > | idle |
| Occurs when the application finishes processing and is about to enter the idle state. | |
| static event< application, event_handler > | leave_thread_modal |
| Occurs when the application is about to leave a modal state. | |
| static event< application, threading::thread_exception_event_handler > | thread_exception |
| Occurs when an untrapped thread exception is thrown. | |
| static event< application, event_handler > | 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 auto | allow_quit () noexcept -> bool |
| Gets a value indicating whether the caller can quit this application. | |
| static auto | application_context () -> xtd::forms::application_context & |
| Gets the application context associate to the application. | |
| static auto | button_images () noexcept -> bool |
| Gets button images are enabled. | |
| static auto | button_images (bool value) -> void |
| Gets button images are enabled. | |
| static auto | common_app_data_path () noexcept -> xtd::string |
| Gets the path for the application data that is shared among all users. | |
| static auto | company_name () noexcept -> xtd::string |
| Gets the company name associated with the application. | |
| static auto | dark_mode () noexcept -> bool |
| Gets a value indicating whether dark mode is enabled for the application. | |
| static auto | dark_mode (bool value) -> void |
| Sets a value indicating whether dark mode is enabled for the application. | |
| static auto | executable_name () noexcept -> xtd::string |
| Gets the executable name for the executable file that started the application, including the executable extension. | |
| static auto | executable_path () noexcept -> xtd::string |
| Gets the path for the executable file that started the application, including the executable name. | |
| static auto | font_size_correction () -> bool |
| Gets a value indicating whether font size correction is enabled. | |
| static auto | font_size_correction (bool value) -> void |
| Sets a value indicating whether font size correction is enabled. | |
| static auto | light_mode () noexcept -> bool |
| Gets a value indicating whether light mode is enabled for the application. | |
| static auto | light_mode (bool value) -> void |
| Sets a value indicating whether light mode is enabled for the application. | |
| static auto | main_form () -> std::optional< form_ref > |
| Gets the optional main form owned by the application. | |
| static auto | menu_images () noexcept -> bool |
| Gets menu images are enabled. | |
| static auto | menu_images (bool value) -> void |
| Sets menu images ilages are enabled. | |
| static auto | message_loop () noexcept -> bool |
| Gets a value indicating whether a message loop exists on this thread. | |
| static auto | open_forms () noexcept -> const form_collection |
| Gets a collection of open forms owned by the application. | |
| static auto | product_name () noexcept -> xtd::string |
| Gets the product name associated with this application. | |
| static auto | product_version () noexcept -> xtd::string |
| Gets the product version associated with this application. | |
| static auto | startup_path () noexcept -> xtd::string |
| Gets the path for the executable file that started the application, not including the executable name. | |
| static auto | style_sheet () noexcept -> const xtd::forms::style_sheets::style_sheet & |
| Gets current xtd::forms::style_sheets::style_sheet style sheet. | |
| static auto | style_sheet (const xtd::forms::style_sheets::style_sheet &value) -> void |
| Sets current xtd::forms::style_sheets::style_sheet style sheet. | |
| static auto | style_sheets () noexcept -> const xtd::forms::style_sheets::style_sheet::style_sheets_t & |
| Gets the installed xtd::forms::style_sheets::style_sheet style sheets. | |
| static auto | style_sheet_names () noexcept -> const xtd::forms::style_sheets::style_sheet::style_sheet_names_t & |
| Gets the installed xtd::forms::style_sheets::style_sheet style sheet names. | |
| static auto | system_controls () noexcept -> bool |
| Gets a value indicating whether the system control is enabled. | |
| static auto | system_controls (bool value) -> void |
| Sets a value indicating whether the system control is enabled. | |
| static auto | system_font_size () noexcept -> bool |
| Gets a value indicating whether the system font size is enabled. | |
| static auto | system_font_size (bool value) -> void |
| Sets a value indicating whether the system font size is enabled. | |
| static auto | system_style_sheet () noexcept -> const xtd::forms::style_sheets::style_sheet & |
| Gets system xtd::forms::style_sheets::style_sheet style sheet. | |
| static auto | user_app_data_path () noexcept -> xtd::string |
| Gets the path for the application data of a user. | |
| static auto | use_wait_cursor () noexcept -> bool |
| Gets whether the wait cursor is used for all open forms of the application. | |
| static auto | use_wait_cursor (bool use_wait_cursor) -> void |
| Sets whether the wait cursor is used for all open forms of the application. | |
| static auto | visual_styles () noexcept -> bool |
| Gets a value that indicates whether visual styles are enabled for the application. | |
| static auto | visual_styles (bool value) -> void |
| Sets a value that indicates whether visual styles are enabled for the application. | |
Public Static Methods | |
| static auto | add_message_filter (const imessage_filter &value) -> void |
| Adds a message filter to monitor Windows messages as they are routed to their destinations. | |
| static auto | do_events () -> void |
| Processes all Windows messages currently in the message queue. | |
| static auto | enable_visual_styles () -> void |
| Enables visual styles for the application. | |
| static auto | exit () -> void |
| Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. | |
| static auto | exit (cancel_event_args &e) -> void |
| Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. | |
| static auto | exit_thread () -> void |
| Exits the message loop on the current thread and closes all windows on the thread. | |
| static auto | get_style_sheet_from_name (const xtd::string &name) -> xtd::forms::style_sheets::style_sheet |
| Gets the installed xtd::forms::style_sheets::style_sheet style sheet from specified name. | |
| static auto | raise_idle (const event_args &e) -> void |
| Raises the Idle event. | |
| static auto | register_message_loop_callback (message_loop_callback callback) -> void |
| Registers a callback for checking whether the message loop is running in hosted environments. | |
| static auto | remove_message_filter (const imessage_filter &value) -> void |
| Removes a message filter from the message pump of the application. | |
| static auto | restart () -> void |
| Shuts down the application and starts a new instance immediately. | |
| static auto | run () -> void |
| Begins running a standard application message loop on the current thread, without a form. | |
| static auto | run (xtd::forms::application_context &context) -> void |
| Begins running a standard application message loop on the current thread, with an application_context. | |
| static auto | run (const form &main_form) -> void |
| Begins running a standard application message loop on the current thread, and makes the specified form visible. | |
Public Deprecated Static Properties | |
| static auto | dark_mode_enabled () noexcept -> bool |
| Return true if dark mode is enabled for the application; otherwise return false. | |
| static auto | light_mode_enabled () noexcept -> bool |
| Return true if dark mode is enabled for the application; otherwise return false. | |
| static auto | use_visual_styles () noexcept -> bool |
| Gets a value that indicates whether visual styles are enabled for the application. | |
PublicDeprecated Static Methods | |
| static auto | enable_button_images () -> void |
| Enables button images for the application. | |
| static auto | enable_dark_mode () -> void |
| Enables dark mode for the application. | |
| static auto | enable_light_mode () -> void |
| Enables light mode for the application. | |
| static auto | enable_menu_images () -> void |
| Enables menu images for the application. | |
|
staticnodiscardnoexcept |
Gets a value indicating whether the caller can quit this application.
|
staticnodiscard |
Gets the application context associate to the application.
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
Gets the path for the application data that is shared among all users.
|
staticnodiscardnoexcept |
Gets the company name associated with the application.
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
Gets the executable name for the executable file that started the application, including the executable extension.
|
staticnodiscardnoexcept |
Gets the path for the executable file that started the application, including the executable name.
|
staticnodiscard |
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. |
|
staticnodiscardnoexcept |
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. |
|
staticnodiscard |
Gets the optional main form owned by the application.
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
Gets a value indicating whether a message loop exists on this thread.
|
staticnodiscardnoexcept |
Gets a collection of open forms owned by the application.
|
staticnodiscardnoexcept |
Gets the product name associated with this application.
|
staticnodiscardnoexcept |
Gets the product version associated with this application.
|
staticnodiscardnoexcept |
Gets the path for the executable file that started the application, not including the executable name.
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheets.
|
staticnodiscardnoexcept |
Gets the installed xtd::forms::style_sheets::style_sheet style sheet names.
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
Gets system xtd::forms::style_sheets::style_sheet style sheet.
|
staticnodiscardnoexcept |
Gets the path for the application data of a user.
|
staticnodiscardnoexcept |
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. |
|
staticnodiscardnoexcept |
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 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.
|
staticnodiscard |
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. |
|
staticnodiscardnoexcept |
Return true if dark mode is enabled for the application; otherwise return false.
|
staticnodiscardnoexcept |
Return true if dark mode is enabled for the application; otherwise return false.
|
staticnodiscardnoexcept |
Gets a value that indicates whether visual styles are enabled for the application.
|
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 |
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 an untrapped thread exception is thrown.
|
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.