C# Class NanoByte.Common.Msg

Provides easier access to typical MessageDialog configurations.
Exibir arquivo Open project: nano-byte/common

Public Methods

Method Description
Inform ( [ owner, [ text, MsgSeverity severity ) : void

Displays a message to the user using a MessageBox or TaskDialog.

OKCancel ( [ owner, [ text, MsgSeverity severity ) : bool

Asks the user a OK/Cancel-question using a MessageDialog.

OkCancel ( [ owner, [ text, MsgSeverity severity ) : bool

Asks the user a OK/Cancel-question using a MessageBox or TaskDialog.

If a MessageBox is used, OK and Cancel are not display to the user, so don't rely on them!

OkCancel ( [ owner, [ text, MsgSeverity severity, [ okCaption, [ cancelCaption = null ) : bool

Asks the user a OK/Cancel-question using a MessageBox or TaskDialog.

If a MessageBox is used, okCaption and cancelCaption are not display to the user, so don't rely on them!

YesNo ( [ owner, [ text, MsgSeverity severity ) : bool

Asks the user to choose between two options (yes/no) using a MessageBox or TaskDialog.

YesNo ( [ owner, [ text, MsgSeverity severity, [ yesCaption, [ noCaption ) : bool

Asks the user to choose between two options (yes/no) using a MessageBox or TaskDialog.

If a MessageBox is used, yesCaption and noCaption are not display to the user, so don't rely on them!

YesNoCancel ( [ owner, [ text, MsgSeverity severity ) : DialogResult

Asks the user to choose between three options (yes/no/cancel) using a MessageBox or TaskDialog.

YesNoCancel ( [ owner, [ text, MsgSeverity severity, [ yesCaption, [ noCaption ) : DialogResult

Asks the user to choose between three options (yes/no/cancel) using a MessageBox or TaskDialog.

If a MessageBox is used, yesCaption and noCaption are not display to the user, so don't rely on them!

YesNoCancel ( [ owner, [ text, MsgSeverity severity ) : ResponseType

Asks the user to choose between three options (yes/no/cancel) using a MessageDialog.

Private Methods

Method Description
GetTaskDialog ( [ text, MsgSeverity severity ) : TaskDialog.TaskDialog

Displays a message using a TaskDialog.

ShowMesageBox ( [ owner, [ text, MsgSeverity severity, MessageBoxButtons buttons ) : DialogResult

Displays a message using a MessageBox.

ShowMessageDialog ( [ owner, [ text, MsgSeverity severity, ButtonsType buttons, bool addCancel = false ) : ResponseType

Displays a message using a MessageDialog.

ShowTaskDialog ( [ taskDialog, [ owner ) : DialogResult

Displays a TaskDialog.

Method Details

Inform() public static method

Displays a message to the user using a MessageBox or TaskDialog.
public static Inform ( [ owner, [ text, MsgSeverity severity ) : void
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
return void

OKCancel() public static method

Asks the user a OK/Cancel-question using a MessageDialog.
public static OKCancel ( [ owner, [ text, MsgSeverity severity ) : bool
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
return bool

OkCancel() public static method

Asks the user a OK/Cancel-question using a MessageBox or TaskDialog.
If a MessageBox is used, OK and Cancel are not display to the user, so don't rely on them!
public static OkCancel ( [ owner, [ text, MsgSeverity severity ) : bool
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
return bool

OkCancel() public static method

Asks the user a OK/Cancel-question using a MessageBox or TaskDialog.
If a MessageBox is used, okCaption and cancelCaption are not display to the user, so don't rely on them!
public static OkCancel ( [ owner, [ text, MsgSeverity severity, [ okCaption, [ cancelCaption = null ) : bool
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
okCaption [ The title and a short description (separated by a linebreak) of the option.
cancelCaption [ The title and a short description (separated by a linebreak) of the option; can be null.
return bool

YesNo() public static method

Asks the user to choose between two options (yes/no) using a MessageBox or TaskDialog.
public static YesNo ( [ owner, [ text, MsgSeverity severity ) : bool
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
return bool

YesNo() public static method

Asks the user to choose between two options (yes/no) using a MessageBox or TaskDialog.
If a MessageBox is used, yesCaption and noCaption are not display to the user, so don't rely on them!
public static YesNo ( [ owner, [ text, MsgSeverity severity, [ yesCaption, [ noCaption ) : bool
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
yesCaption [ The title and a short description (separated by a linebreak) of the option.
noCaption [ The title and a short description (separated by a linebreak) of the option.
return bool

YesNoCancel() public static method

Asks the user to choose between three options (yes/no/cancel) using a MessageBox or TaskDialog.
public static YesNoCancel ( [ owner, [ text, MsgSeverity severity ) : DialogResult
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
return DialogResult

YesNoCancel() public static method

Asks the user to choose between three options (yes/no/cancel) using a MessageBox or TaskDialog.
If a MessageBox is used, yesCaption and noCaption are not display to the user, so don't rely on them!
public static YesNoCancel ( [ owner, [ text, MsgSeverity severity, [ yesCaption, [ noCaption ) : DialogResult
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
yesCaption [ The title and a short description (separated by a linebreak) of the option.
noCaption [ The title and a short description (separated by a linebreak) of the option.
return DialogResult

YesNoCancel() public static method

Asks the user to choose between three options (yes/no/cancel) using a MessageDialog.
public static YesNoCancel ( [ owner, [ text, MsgSeverity severity ) : ResponseType
owner [ The parent window the displayed window is modal to; can be null.
text [ The message to be displayed.
severity MsgSeverity How severe/important the message is.
return ResponseType