Habanero.Faces.Base.DateRangeComboBoxManager.CalculateDates C# (CSharp) Method

CalculateDates() private method

Calculates the start and end dates based on the currently selected ComboBox item
private CalculateDates ( ) : void
return void
        private void CalculateDates()
        {
            if (!_dateRangePairs.ContainsValue(this._comboBox.Text))
            {
                _range = new DateRange(DateTime.MinValue, DateTime.MaxValue);
                return;
            }

            DateRangeOptions option = DateRangeOptions.Today;
            bool found = false;
            foreach (KeyValuePair<DateRangeOptions, string> pair in _dateRangePairs)
            {
                if (pair.Value == (string)_comboBox.SelectedItem)
                {
                    option = pair.Key;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                _range = new DateRange(DateTime.MinValue, DateTime.MaxValue);
                return;
            }
            _dateRangeConverter.SetNow(Now);
            _range = _dateRangeConverter.ConvertDateRange(option);
        }