Class GorgonDialogs
Class used to display various dialog types with enhanced abilities over that of the standard MessageBox class.
Inherited Members
Namespace: Gorgon.UI
Assembly: Gorgon.Windows.dll
Syntax
public static class GorgonDialogs
Methods
| Edit this page View SourceConfirmBox(IWin32Window, string, string, bool, bool)
Function to display a confirmation dialog.
Declaration
public static ConfirmationResult ConfirmBox(IWin32Window owner, string message, string caption = "", bool allowCancel = false, bool allowToAll = false)
Parameters
Type | Name | Description |
---|---|---|
IWin32Window | owner | The owning window of this dialog. |
string | message | The confirmation message to display. |
string | caption | [Optional] The caption for the dialog. |
bool | allowCancel | [Optional] true to show a Cancel button, false to hide. |
bool | allowToAll | [Optional] true to show a To all checkbox, false to hide. |
Returns
Type | Description |
---|---|
ConfirmationResult | A flag from the ConfirmationResult enumeration. If the |
Remarks
This will display a confirmation dialog with an optional Cancel button, and an optional "To all" checkbox.
If the "Yes" button is clicked, this method will return the Yes flag, or if the "No" button is clicked, this method will return the No flag.
When the allowToAll
parameter is set to true, this method may return Yes or No OR'd with the
ToAll flag when the "to all" checkbox is checked. This is meant to indicate "Yes to all", or "No to all".
Setting the allowCancel
parameter to true will display a cancel button and will allow the method to return the Cancel flag. This flag is
exclusive and is not combined with the ToAll flag under any circumstances.
ErrorBox(IWin32Window, Exception)
Function to display the enhanced error dialog.
Declaration
public static void ErrorBox(IWin32Window owner, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
IWin32Window | owner | The owning window of this dialog. |
Exception | exception | The exception that was thrown. |
Remarks
This will display an enhanced error dialog with a details button that will have exception
information in the details pane.
ErrorBox(IWin32Window, string, string, Exception, bool)
Function to display the enhanced error dialog.
Declaration
public static void ErrorBox(IWin32Window owner, string message, string caption, Exception exception, bool autoShowDetails = false)
Parameters
Type | Name | Description |
---|---|---|
IWin32Window | owner | The owning window of this dialog. |
string | message | The error message to display. |
string | caption | The caption for the error box. |
Exception | exception | The exception that was thrown. |
bool | autoShowDetails | [Optional] true to open the details pane when the window is made visible, false to leave it closed. |
Remarks
This will display an enhanced error dialog with a details button that will have exception
information in the details pane.
If autoShowDetails
is set to true, then the details pane will automatically be shown when the window appears.
If the message
parameter is null or an empty string, then the Message property is used to display the error message.
ErrorBox(IWin32Window, string, string, string, bool)
Function to display the enhanced error dialog.
Declaration
public static void ErrorBox(IWin32Window owner, string message, string caption = "", string details = "", bool autoShowDetails = false)
Parameters
Type | Name | Description |
---|---|---|
IWin32Window | owner | The owning window of this dialog. |
string | message | The error message to display. |
string | caption | [Optional] The caption for the error box. |
string | details | [Optional] The detailed information about the error. |
bool | autoShowDetails | [Optional] true to open the details pane when the window is made visible, false to leave it closed. |
Remarks
This will display an enhanced error dialog with a details button. This button will expand the window to show the details
passed to the method. If the details
are null, or empty, then the details button will not show.
If autoShowDetails
is set to true, then the details pane will automatically be shown when the window appears. This only applies when the details
parameter
has information passed to it.
InfoBox(IWin32Window, string, string)
Function to display the enhanced information dialog.
Declaration
public static void InfoBox(IWin32Window owner, string message, string caption = "")
Parameters
Type | Name | Description |
---|---|---|
IWin32Window | owner | The owning window of this dialog. |
string | message | The informational message to display. |
string | caption | [Optional] The caption for the dialog. |
Remarks
This will display an enhanced information dialog that is capable of showing more text than the standard MessageBox.
WarningBox(IWin32Window, string, string, string, bool)
Function to display the enhanced warning dialog.
Declaration
public static void WarningBox(IWin32Window owner, string message, string caption = "", string details = "", bool autoShowDetails = false)
Parameters
Type | Name | Description |
---|---|---|
IWin32Window | owner | The owning window of this dialog. |
string | message | The warning message to display. |
string | caption | [Optional] The caption for the warning box. |
string | details | [Optional] The details for the warning. |
bool | autoShowDetails | [Optional] true to open the details pane when the window is made visible, false to leave it closed. |
Remarks
This will show an enhanced warning dialog with a details button. This button will expand the window to show the details
passed to the method. If the details
are null, or empty, then the details button will not show.
If autoShowDetails
is set to true, then the details pane will automatically be shown when the window appears. This only applies when the details
parameter
has information passed to it.