Exemplo n.º 1
0
        /// <summary>
        /// Event callback.
        /// Called when a SRS level is selected from the level picker.
        /// </summary>
        private void OnSrsLevelSelected(object sender, SrsLevelSelectedEventArgs e)
        {
            if (e.SelectedLevel != null)
            {
                Entry.CurrentGrade = (short)e.SelectedLevel.Value;

                if ((e.SelectedLevel.Value == _originalLevelValue &&
                     _originalNextReviewDate.HasValue) ||
                    (_isFirstSrsLevelSelect && !IsNew))
                {
                    // Reset the original Next Answer Date.
                    Entry.NextAnswerDate   = _originalNextReviewDate;
                    _isFirstSrsLevelSelect = false;
                }
                else
                {
                    if (e.SelectedLevel.Delay.HasValue)
                    {
                        Entry.NextAnswerDate = DateTime.Now + e.SelectedLevel.Delay.Value;
                    }
                    else
                    {
                        Entry.NextAnswerDate = null;
                    }
                }
            }
        }
 /// <summary>
 /// Event callback.
 /// Called when a SRS level is selected in the level picker VM.
 /// Raises a filter change.
 /// </summary>
 private void OnSrsLevelSelected(object sender, SrsLevelSelectedEventArgs e)
 {
     RaiseFilterChanged();
 }