Ejemplo n.º 1
0
        /// <summary>
        /// Gets the previoust lesson if available.
        /// </summary>
        /// <returns>The previoust lesson.</returns>
        /// <param name="currentLesson">Current lesson.</param>
        public Lesson GetPrevioustLesson(Lesson currentLesson)
        {
            if (HasPreviousLesson(currentLesson))
            {
                var index = Lessons.IndexOf(currentLesson) - 1;
                return Lessons.ElementAt(index);
            }

            return null;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the next lesson if available.
        /// </summary>
        /// <returns>The next lesson.</returns>
        /// <param name="currentLesson">Current lesson.</param>
        public Lesson GetNextLesson(Lesson currentLesson)
        {
            if (HasNextLesson(currentLesson))
            {
                var index = Lessons.IndexOf(currentLesson) + 1;
                return Lessons.ElementAt(index);
            }

            return null;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Determines whether there is a next lesson available from the provided lesson
 /// </summary>
 /// <returns><c>true</c> if this module has a next lesson; otherwise, <c>false</c>.</returns>
 /// <param name="currentLesson">Current lesson.</param>
 public bool HasNextLesson(Lesson currentLesson)
 {
     var index = Lessons.IndexOf(currentLesson);
     return Lessons.Count - 1 > index;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Determines whether there is a previous lesson available from the provided lesson
 /// </summary>
 /// <returns><c>true</c> if this module has a previous lesson; otherwise, <c>false</c>.</returns>
 /// <param name="currentLesson">Current lesson.</param>
 public bool HasPreviousLesson(Lesson currentLesson)
 {
     var index = Lessons.IndexOf(currentLesson);
     return index > 0;
 }
Ejemplo n.º 5
0
 public ProgressListRefreshRequestedEventArgs(Lesson lesson)
     : base()
 {
     this.Lesson = lesson;
 }
Ejemplo n.º 6
0
 protected void FireProgressListRefreshRequested(Lesson lesson)
 {
     if (ProgressListRefreshRequested != null)
         ProgressListRefreshRequested(this, new ProgressListRefreshRequestedEventArgs(lesson));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Returns a new instance of the fragment type according to the type of lesson
        /// </summary>
        /// <returns>The fragment for the lesson.</returns>
        /// <param name="lesson">current lesson.</param>
        private LessonFragment CreateFragmentForLesson(Lesson lesson)
        {
            if (lesson is HearMe)
                return new HearMeFragment(lesson);
            if (lesson is FourPictures)
                return new FourPicturesFragment(lesson);
            if (lesson is PickSyllable)
                return new PickSyllableFragment(lesson);
            if (lesson is BuildSyllable)
                return new BuildSyllableFragment(lesson);
            if (lesson is FindMissingLetter)
                return new FindMissingLetterFragment(lesson);
            if (lesson is AbcRank)
                return new AbcRankFragment(lesson);
            if (lesson is LetterDrop)
                return new LetterDropFragment(lesson);

            return null;
        }