[This is preliminary documentation and is subject to change.]

Provides technology-independent managed base class for WinForms and WPF message boxes

Namespace:  Tools.WindowsT.IndependentT
Assembly:  Tools.Windows (in Tools.Windows.dll) Version: 1.5.2.0

Author: Đonny (dzonny@dzonny.cz)

Vertion history

1.5.2 (Nightly)
  • VersionAttribute and AuthorAttribute removed
  • Fixed: Some static functions throws exception when icon is not set or when default button is used (even implicitly)

Syntax

C#
[DefaultEventAttribute("Closed")]
[DefaultPropertyAttribute("Prompt")]
public abstract class MessageBox : Component, 
	IReportsChange
Visual Basic (Declaration)
<DefaultEventAttribute("Closed")> _
<DefaultPropertyAttribute("Prompt")> _
Public MustInherit Class MessageBox _
	Inherits Component _
	Implements IReportsChange
Visual C++
[DefaultEventAttribute(L"Closed")]
[DefaultPropertyAttribute(L"Prompt")]
public ref class MessageBox abstract : public Component, 
	IReportsChange
J#
/** @attribute DefaultEventAttribute("Closed") */
/** @attribute DefaultPropertyAttribute("Prompt") */
public abstract class MessageBox extends Component implements IReportsChange
JScript
public abstract class MessageBox extends Component implements IReportsChange

Remarks

This class implements IReportsChange and has plenty of events fo reporting changes of property values. Also types of some properties reports events when their properties are changed. The aim of such behavior is to provide dynamic message box which can be changed as it is displayd. However it is up to derived class which changes it will track and interpret as changes of dialog.

After message box is closed, it can be shown again (so called re-cycling; see Recycle()()()).

In order to prevent confusing multiple overloads, names of Modal_*, ModalF_*, ModelEx_* and Error_* functions are suffixed with abberivations of accepted parameters. The Show(Window, String) method stays overloaded. Meaning of abberivations are following:

Abbr.Meaning
aargs - Formatting string arguments
BButtons - Either MessageBox..::.MessageBoxButton objects or or-ed values of MessageBox..::.MessageBoxButton..::.Buttons
EItems - assorted items to be shown on message box such as buttons, checkboxes, comboboxes etc.
HShowHandler - delegate to be called when message box is shown
IIcon - Either Icon, Image or MessageBox..::.MessageBoxIcons defining picture to be shown on message box
MTimer - Defines count-down time for self-closing message box
OOptions - A MessageBox..::.MessageBoxOptions value
PPrompt - Main text to be shown to user
SSound - Sound to be played when message box is shown
TTitle - Text of message box header (title bar)
WOwner - Owner of messagebox - the window to which the message box will be modal
XException - Exception message box will show information about

Inheritance Hierarchy

See Also