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
ファイルを表示 Open project: 2014-sed-team3/term-project

Protected Properties

Property Type Description
m_sApplicationName String

Public Methods

Method 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

Method Description
FormUtil ( ) : System

Static constructor for the FormUtil class.

Method Details

EnableControls() public static method

public static EnableControls ( System.Boolean bEnable ) : void
bEnable System.Boolean
return void

EnableControls() public static method

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

OnInvalidComboBox() public static method

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

OnInvalidControl() public static method

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

OnInvalidDateTimePicker() public static method

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

OnInvalidNumericUpDown() public static method

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

OnInvalidTextBox() public static method

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

ShowError() public static method

public static ShowError ( String sText ) : void
sText String
return void

ShowInformation() public static method

public static ShowInformation ( String sText ) : void
sText String
return void

ShowWarning() public static method

public static ShowWarning ( String sText ) : void
sText String
return void

TrimTextBox() public static method

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

ValidateDirectoryTextBox() public static method

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

ValidateDoubleTextBox() public static method

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
return System.Boolean

ValidateFileTextBox() public static method

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

ValidateInt32TextBox() public static method

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
return System.Boolean

ValidateListBoxSelection() public static method

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

ValidateNumericUpDown() public static method

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

ValidateNumericUpDown() public static method

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

ValidateNumericUpDown() public static method

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

ValidateNumericUpDown() public static method

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

ValidateRequiredComboBox() public static method

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

ValidateRequiredTextBox() public static method

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

Property Details

m_sApplicationName protected_oe static_oe property

protected static String m_sApplicationName
return String