C# Class Smrf.AppLib.FormUtil

Form utility methods.
This class contains a set of static methods for displaying messages and validating controls. It is meant for use by Form and classes.

Most of the functionality in this class is also in the class, which can serve as a base class for derived forms.

Inheritance: Object
Afficher le fichier Open project: 2014-sed-team3/term-project

Protected Properties

Свойство Type Description
m_sApplicationName String

Méthodes publiques

Méthode Description
EnableControls ( System.Boolean bEnable ) : void
EnableControls ( System.Boolean bEnable, Control oControls ) : void
OnInvalidComboBox ( ComboBox oComboBox, String sErrorMessage ) : System.Boolean
OnInvalidControl ( Control oControl, String sErrorMessage ) : System.Boolean
OnInvalidDateTimePicker ( DateTimePicker oDateTimePicker, String sErrorMessage ) : System.Boolean
OnInvalidNumericUpDown ( NumericUpDown oNumericUpDown, String sErrorMessage ) : System.Boolean
OnInvalidTextBox ( TextBox oTextBox, String sErrorMessage ) : System.Boolean
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

Méthode Description
FormUtil ( ) : System

Static constructor for the FormUtil class.

Method Details

EnableControls() public static méthode

public static EnableControls ( System.Boolean bEnable ) : void
bEnable System.Boolean
Résultat void

EnableControls() public static méthode

public static EnableControls ( System.Boolean bEnable, Control oControls ) : void
bEnable System.Boolean
oControls System.Windows.Forms.Control
Résultat void

OnInvalidComboBox() public static méthode

public static OnInvalidComboBox ( ComboBox oComboBox, String sErrorMessage ) : System.Boolean
oComboBox System.Windows.Forms.ComboBox
sErrorMessage String
Résultat System.Boolean

OnInvalidControl() public static méthode

public static OnInvalidControl ( Control oControl, String sErrorMessage ) : System.Boolean
oControl System.Windows.Forms.Control
sErrorMessage String
Résultat System.Boolean

OnInvalidDateTimePicker() public static méthode

public static OnInvalidDateTimePicker ( DateTimePicker oDateTimePicker, String sErrorMessage ) : System.Boolean
oDateTimePicker System.Windows.Forms.DateTimePicker
sErrorMessage String
Résultat System.Boolean

OnInvalidNumericUpDown() public static méthode

public static OnInvalidNumericUpDown ( NumericUpDown oNumericUpDown, String sErrorMessage ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sErrorMessage String
Résultat System.Boolean

OnInvalidTextBox() public static méthode

public static OnInvalidTextBox ( TextBox oTextBox, String sErrorMessage ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
Résultat System.Boolean

ShowError() public static méthode

public static ShowError ( String sText ) : void
sText String
Résultat void

ShowInformation() public static méthode

public static ShowInformation ( String sText ) : void
sText String
Résultat void

ShowWarning() public static méthode

public static ShowWarning ( String sText ) : void
sText String
Résultat void

TrimTextBox() public static méthode

public static TrimTextBox ( TextBox oTextBox ) : String
oTextBox System.Windows.Forms.TextBox
Résultat String

ValidateDirectoryTextBox() public static méthode

public static ValidateDirectoryTextBox ( TextBox oTextBox, String sErrorMessage, String &sDirectory ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
sDirectory String
Résultat System.Boolean

ValidateDoubleTextBox() public static méthode

public static 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
Résultat System.Boolean

ValidateFileTextBox() public static méthode

public static ValidateFileTextBox ( TextBox oTextBox, String sErrorMessage, String &sFile ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
sFile String
Résultat System.Boolean

ValidateInt32TextBox() public static méthode

public static 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
Résultat System.Boolean

ValidateListBoxSelection() public static méthode

public static ValidateListBoxSelection ( ListBox oListBox, String sErrorMessage ) : System.Boolean
oListBox System.Windows.Forms.ListBox
sErrorMessage String
Résultat System.Boolean

ValidateNumericUpDown() public static méthode

public static ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Decimal &decValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
decValue Decimal
Résultat System.Boolean

ValidateNumericUpDown() public static méthode

public static ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Double &dValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
dValue Double
Résultat System.Boolean

ValidateNumericUpDown() public static méthode

public static ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, Int32 &iValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
iValue System.Int32
Résultat System.Boolean

ValidateNumericUpDown() public static méthode

public static ValidateNumericUpDown ( NumericUpDown oNumericUpDown, String sValueDescription, System.Single &fValue ) : System.Boolean
oNumericUpDown System.Windows.Forms.NumericUpDown
sValueDescription String
fValue System.Single
Résultat System.Boolean

ValidateRequiredComboBox() public static méthode

public static ValidateRequiredComboBox ( ComboBox oComboBox, String sErrorMessage, String &sTrimmedText ) : System.Boolean
oComboBox System.Windows.Forms.ComboBox
sErrorMessage String
sTrimmedText String
Résultat System.Boolean

ValidateRequiredTextBox() public static méthode

public static ValidateRequiredTextBox ( TextBox oTextBox, String sErrorMessage, String &sTrimmedText ) : System.Boolean
oTextBox System.Windows.Forms.TextBox
sErrorMessage String
sTrimmedText String
Résultat System.Boolean

Property Details

m_sApplicationName protected_oe static_oe property

protected static String m_sApplicationName
Résultat String