示例#1
0
文件: Module.cs 项目: fawuser/IRMGARD
        /// <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;
        }
示例#2
0
文件: Module.cs 项目: fawuser/IRMGARD
        /// <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;
        }
示例#3
0
文件: Module.cs 项目: fawuser/IRMGARD
 /// <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;
 }
示例#4
0
文件: Module.cs 项目: fawuser/IRMGARD
 /// <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;
 }
示例#5
0
 public ProgressListRefreshRequestedEventArgs(Lesson lesson)
     : base()
 {
     this.Lesson = lesson;
 }
示例#6
0
 protected void FireProgressListRefreshRequested(Lesson lesson)
 {
     if (ProgressListRefreshRequested != null)
         ProgressListRefreshRequested(this, new ProgressListRefreshRequestedEventArgs(lesson));
 }
示例#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;
        }