public void SetDateRangeString(DateRangeOptions option, string newDisplayString)
{
if (_optionsToDisplay.Contains(option))
{
if (_dateRangePairs.ContainsValue(newDisplayString)
&& _dateRangePairs[option] != newDisplayString)
{
throw new ArgumentException("A date range display string " +
"is being assigned, but that display string has already " +
"been used.");
}
int comboBoxPos = _comboBox.Items.IndexOf(_dateRangePairs[option]);
_comboBox.Items[comboBoxPos] = newDisplayString;
_dateRangePairs[option] = newDisplayString;
}
else
{
throw new ArgumentException("A date range string is being changed, " +
"but the given option does not exist in the collection " +
"of date options.");
}
}