Exemplo n.º 1
0
		public void LoadDefaultDateIntervalOptions(IEnumerable<NameValuePair> options, DateIntervalSpans selectedOption)
		{
			_defaultDateIntervalFilterComboBox.Items.Clear();

			foreach (var option in options)
			{
				var index = _defaultDateIntervalFilterComboBox.Items.Add(option);
				if (option.Value == ((int)selectedOption).ToString(CultureInfo.InvariantCulture))
				{
					_defaultDateIntervalFilterComboBox.SelectedIndex = index;
				}
			}
		}
Exemplo n.º 2
0
		public static DateInterval Create(DateIntervalSpans span, DateTime today)
		{
			switch (span)
			{
				case DateIntervalSpans.Week:
					return new DateInterval(today.AddDays(-7), today);
				case DateIntervalSpans.Month:
					return new DateInterval(today.AddMonths(-1), today);
				case DateIntervalSpans.Year:
					return new DateInterval(today.AddYears(-1), today);
			}

			return null;
		}
 public void SetDefaultDateInterval(DateIntervalSpans interval)
 {
     _defaultDateInterval = interval;
 }
 public void SetDefaultDateInterval(DateIntervalSpans interval)
 {
     UserSettings.Default.DefaultDateInterval = (int)interval;
 }