btnAddMinimumValue_Click
(
object sender,
EventArgs e
)
{
AssertValid();
ExcelColumnFormat eSelectedVertexColumnFormat =
this.SelectedVertexColumnFormat;
switch (eSelectedVertexColumnFormat)
{
case ExcelColumnFormat.Number:
Double dMinimumValue;
if ( !ValidateDoubleTextBox(txbMinimumValueToAdd,
Double.MinValue, Double.MaxValue, "Enter a numeric value.",
out dMinimumValue) )
{
return;
}
lbxMinimumValues.AddItem<FormattableNumber, Double>(
new FormattableNumber(dMinimumValue) );
txbMinimumValueToAdd.Focus();
txbMinimumValueToAdd.SelectAll();
return;
case ExcelColumnFormat.Date:
lbxMinimumValues.AddItem<FormattableDate, DateTime>(
new FormattableDate(dtpMinimumValueToAdd.Value) );
break;
case ExcelColumnFormat.Time:
lbxMinimumValues.AddItem<FormattableTime, DateTime>(
new FormattableTime(dtpMinimumValueToAdd.Value) );
break;
case ExcelColumnFormat.DateAndTime:
lbxMinimumValues.AddItem<FormattableDateAndTime, DateTime>(
new FormattableDateAndTime(dtpMinimumValueToAdd.Value) );
break;
case ExcelColumnFormat.Other:
// This should never occur, because the Add button is disabled
// when the column format is Other.
Debug.Assert(false);
break;
default:
Debug.Assert(false);
break;
}
dtpMinimumValueToAdd.Focus();
}