internal bool MoveCurrentDown(bool isControlModifierDown) { bool handled = false; if (isControlModifierDown) { if (this.CurrentDate != DateTime.MinValue && this.Owner.DisplayMode != CalendarDisplayMode.MonthView) { this.Owner.RaiseMoveToLowerCommand(this.CurrentDate); // CurrentDate is not changed but we need to update the visuals on view change. this.AsyncUpdateCurrencyPresenters(this.CurrentDate, this.CurrentDate); handled = true; } } else { if (this.CurrentDate == DateTime.MinValue) { this.CurrentDate = CalendarMathHelper.GetFirstDateForCurrentDisplayUnit(this.Owner.DisplayDate, this.Owner.DisplayMode); } else { DateTime dateToNavigate = CalendarMathHelper.IncrementByCell(this.CurrentDate, this.Owner.Model.ColumnCount, this.Owner.DisplayMode); this.Owner.RaiseMoveToDateCommand(dateToNavigate); this.CurrentDate = dateToNavigate; } handled = true; } return(handled); }
internal bool MoveCurrentToFirst() { bool handled = true; this.CurrentDate = CalendarMathHelper.GetFirstDateForCurrentDisplayUnit(this.Owner.DisplayDate, this.Owner.DisplayMode); return(handled); }
internal bool MoveCurrentUp(bool isControlModifierDown) { bool handled = false; if (isControlModifierDown) { if (this.Owner.DisplayMode != CalendarDisplayMode.CenturyView) { this.Owner.RaiseMoveToUpperViewCommand(); if (this.CurrentDate != DateTime.MinValue) { this.AsyncUpdateCurrencyPresenters(this.CurrentDate, this.CurrentDate); } handled = true; } } else { if (this.CurrentDate == DateTime.MinValue) { this.CurrentDate = CalendarMathHelper.GetFirstDateForCurrentDisplayUnit(this.Owner.DisplayDate, this.Owner.DisplayMode); } else { DateTime dateToNavigate = CalendarMathHelper.IncrementByCell(this.CurrentDate, -this.Owner.Model.ColumnCount, this.Owner.DisplayMode); this.Owner.RaiseMoveToDateCommand(dateToNavigate); this.CurrentDate = dateToNavigate; } handled = true; } return(handled); }
internal bool MoveCurrentToNext(bool isControlModifierDown) { bool handled = true; if (isControlModifierDown) { if (this.CurrentDate == DateTime.MinValue) { DateTime dateToNavigate = CalendarMathHelper.IncrementByView(this.Owner.DisplayDate, 1, this.Owner.DisplayMode); this.Owner.RaiseMoveToDateCommand(dateToNavigate); } else { DateTime dateToNavigate = CalendarMathHelper.IncrementByView(this.CurrentDate, 1, this.Owner.DisplayMode); this.Owner.RaiseMoveToDateCommand(dateToNavigate); this.CurrentDate = dateToNavigate; } } else { if (this.CurrentDate == DateTime.MinValue) { this.CurrentDate = CalendarMathHelper.GetFirstDateForCurrentDisplayUnit(this.Owner.DisplayDate, this.Owner.DisplayMode); } else { DateTime dateToNavigate = CalendarMathHelper.IncrementByCell(this.CurrentDate, 1, this.Owner.DisplayMode); this.Owner.RaiseMoveToDateCommand(dateToNavigate); this.CurrentDate = dateToNavigate; } } return(handled); }