C# Class Smrf.AppLib.FormPlus

Represents a Form with additional features.
This class contains a set of methods for displaying messages and validating controls. It also implements an OnFirstActivated virtual method that the derived class can use to run time-consuming initialization code without preventing the form from appearing.

Most of the functionality in this class is also avaialable as a set of static methods in the FormUtil class.

Inheritance: System.Windows.Forms.Form
Mostrar archivo Open project: 2014-sed-team3/term-project

Protected Properties

Property Type Description
m_bActivated System.Boolean

Public Methods

Method Description
FindControlByName ( String sName ) : Control
FormPlus ( ) : System

Initializes a new instance of the FormPlus class.

Protected Methods

Method Description
CheckAllCheckBoxes ( Control oParentControl, System.Boolean bCheck ) : void
CheckCheckBoxes ( System.Boolean bCheck ) : void
EnableControls ( System.Boolean bEnable ) : void
EnableControls ( System.Boolean bEnable, Control oControls ) : void
EnsureVisible ( ) : void
EnsureVisibleOnVisibleChanged ( Object sender, EventArgs e ) : void
FindControlByName ( String sName, Control oChildControls, Control &oControl ) : System.Boolean
OnActivated ( EventArgs e ) : void
OnFirstActivated ( ) : void
OnInvalidComboBox ( ComboBox oComboBox, String sErrorMessage ) : System.Boolean
OnInvalidControl ( Control control, String errorMessage ) : System.Boolean
OnInvalidDateTimePicker ( DateTimePicker oDateTimePicker, String sErrorMessage ) : System.Boolean
OnInvalidNumericUpDown ( NumericUpDown oNumericUpDown, String sErrorMessage ) : System.Boolean
OnInvalidTextBox ( TextBox oTextBox, String sErrorMessage ) : System.Boolean
PreventClosure ( Object sender, System e ) : void
ShowError ( String sText ) : void
ShowInformation ( String sText ) : void
ShowWarning ( String sText ) : void
TrimTextBox ( TextBox oTextBox ) : String
ValidateDirectoryTextBox ( TextBox oTextBox, String sErrorMessage, String &sDirectory ) : System.Boolean
ValidateDoubleTextBox ( TextBox oTextBox, Double dMinValue, Double dMaxValue, String sErrorMessage, Double &dDouble ) : System.Boolean
ValidateFileTextBox ( TextBox oTextBox, String sErrorMessage, String &sFile ) : System.Boolean
ValidateInt32TextBox ( TextBox oTextBox, Int32 iMinValue, Int32 iMaxValue, String sErrorMessage, Int32 &iInt32 ) : System.Boolean
ValidateListBoxSelection ( ListBox oListBox, String sErrorMessage ) : System.Boolean
ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Decimal &decValue ) : System.Boolean
ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Double &dValue ) : System.Boolean
ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Int32 &iValue ) : System.Boolean
ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, System.Single &fValue ) : System.Boolean
ValidateRequiredComboBox ( ComboBox oComboBox, String sErrorMessage, String &sTrimmedText ) : System.Boolean
ValidateRequiredTextBox ( TextBox oTextBox, String sErrorMessage, String &sTrimmedText ) : System.Boolean

Private Methods

Method Description
AssertValid ( ) : void

Method Details

CheckAllCheckBoxes() protected method

protected CheckAllCheckBoxes ( Control oParentControl, System.Boolean bCheck ) : void
oParentControl System.Windows.Forms.Control
bCheck System.Boolean
return void

CheckCheckBoxes() protected method

protected CheckCheckBoxes ( System.Boolean bCheck ) : void
bCheck System.Boolean
return void

EnableControls() protected method

protected EnableControls ( System.Boolean bEnable ) : void
bEnable System.Boolean
return void

EnableControls() protected method

protected EnableControls ( System.Boolean bEnable, Control oControls ) : void
bEnable System.Boolean
oControls System.Windows.Forms.Control
return void

EnsureVisible() protected method

protected EnsureVisible ( ) : void
return void

EnsureVisibleOnVisibleChanged() protected method

protected EnsureVisibleOnVisibleChanged ( Object sender, EventArgs e ) : void
sender Object
e System.EventArgs
return void

FindControlByName() protected method

protected FindControlByName ( String sName, Control oChildControls, Control &oControl ) : System.Boolean
sName String
oChildControls System.Windows.Forms.Control
oControl System.Windows.Forms.Control
return System.Boolean

FindControlByName() public method

public FindControlByName ( String sName ) : Control
sName String
return System.Windows.Forms.Control

FormPlus() public method

Initializes a new instance of the FormPlus class.
public FormPlus ( ) : System
return System

OnActivated() protected method

protected OnActivated ( EventArgs e ) : void
e System.EventArgs
return void

OnFirstActivated() protected method

protected OnFirstActivated ( ) : void
return void

OnInvalidComboBox() protected method

protected OnInvalidComboBox ( ComboBox oComboBox, String sErrorMessage ) : System.Boolean
oComboBox System.Windows.Forms.ComboBox
sErrorMessage String
return System.Boolean

OnInvalidControl() protected method

protected OnInvalidControl ( Control control, String errorMessage ) : System.Boolean
control System.Windows.Forms.Control
errorMessage String
return System.Boolean

OnInvalidDateTimePicker() protected method

protected OnInvalidDateTimePicker ( DateTimePicker oDateTimePicker, String sErrorMessage ) : System.Boolean
oDateTimePicker System.Windows.Forms.DateTimePicker
sErrorMessage String
return System.Boolean

OnInvalidNumericUpDown() protected method

protected OnInvalidNumericUpDown ( NumericUpDown oNumericUpDown, String sErrorMessage ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sErrorMessage String
return System.Boolean

OnInvalidTextBox() protected method

protected OnInvalidTextBox ( TextBox oTextBox, String sErrorMessage ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
return System.Boolean

PreventClosure() protected method

protected PreventClosure ( Object sender, System e ) : void
sender Object
e System
return void

ShowError() protected method

protected ShowError ( String sText ) : void
sText String
return void

ShowInformation() protected method

protected ShowInformation ( String sText ) : void
sText String
return void

ShowWarning() protected method

protected ShowWarning ( String sText ) : void
sText String
return void

TrimTextBox() protected method

protected TrimTextBox ( TextBox oTextBox ) : String
oTextBox System.Windows.Forms.TextBox
return String

ValidateDirectoryTextBox() protected method

protected ValidateDirectoryTextBox ( TextBox oTextBox, String sErrorMessage, String &sDirectory ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
sDirectory String
return System.Boolean

ValidateDoubleTextBox() protected method

protected ValidateDoubleTextBox ( TextBox oTextBox, Double dMinValue, Double dMaxValue, String sErrorMessage, Double &dDouble ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
dMinValue Double
dMaxValue Double
sErrorMessage String
dDouble Double
return System.Boolean

ValidateFileTextBox() protected method

protected ValidateFileTextBox ( TextBox oTextBox, String sErrorMessage, String &sFile ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
sFile String
return System.Boolean

ValidateInt32TextBox() protected method

protected ValidateInt32TextBox ( TextBox oTextBox, Int32 iMinValue, Int32 iMaxValue, String sErrorMessage, Int32 &iInt32 ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
iMinValue System.Int32
iMaxValue System.Int32
sErrorMessage String
iInt32 System.Int32
return System.Boolean

ValidateListBoxSelection() protected method

protected ValidateListBoxSelection ( ListBox oListBox, String sErrorMessage ) : System.Boolean
oListBox System.Windows.Forms.ListBox
sErrorMessage String
return System.Boolean

ValidateNumericUpDown() protected method

protected ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Decimal &decValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
decValue Decimal
return System.Boolean

ValidateNumericUpDown() protected method

protected ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Double &dValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
dValue Double
return System.Boolean

ValidateNumericUpDown() protected method

protected ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Int32 &iValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
iValue System.Int32
return System.Boolean

ValidateNumericUpDown() protected method

protected ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, System.Single &fValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
fValue System.Single
return System.Boolean

ValidateRequiredComboBox() protected method

protected ValidateRequiredComboBox ( ComboBox oComboBox, String sErrorMessage, String &sTrimmedText ) : System.Boolean
oComboBox System.Windows.Forms.ComboBox
sErrorMessage String
sTrimmedText String
return System.Boolean

ValidateRequiredTextBox() protected method

protected ValidateRequiredTextBox ( TextBox oTextBox, String sErrorMessage, String &sTrimmedText ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
sTrimmedText String
return System.Boolean

Property Details

m_bActivated protected_oe property

protected Boolean,System m_bActivated
return System.Boolean