Beispiel #1
0
        private void LoadNextVerse()
        {
            if (!HasStarted)
            {
                return;
            }

            StopTimer();

            FinishedVerse(CurrentVerse);

            if (CurrentVerse.Field <int>("SequenceInBook") == CurrentBook.AsEnumerable().Max(p => p.Field <int>("SequenceInBook")))
            {
                if ((BookEnum)CurrentVerse.Field <int>("BookId") == BookEnum.Revelation)
                {
                    // Finalizou a leitura. Terminamos.
                    Stop(false);
                    return;
                }

                // Terminou a leitura do livro atual. Vamos para o próximo livro.
                LoadNextBook();
                return;
            }

            // Próximo versículo do livro atual.
            CurrentVerse = GetNextVerse(CurrentVerse);

            UpdateVerse();
        }
Beispiel #2
0
        private void UpdateStatistics()
        {
            var s = string.Empty;

// ReSharper disable JoinDeclarationAndInitializer
            int      wordsRemaining;
            int      secondsRemaining;
            TimeSpan timeToFinish;

            //int versesRemaining;
// ReSharper restore JoinDeclarationAndInitializer

            wordsRemaining   = BibleWords - User.Field <int>("ReadWordCount");
            secondsRemaining = 60 * wordsRemaining / User.Field <int>("WordsPerMinute");
            timeToFinish     = TimeSpan.FromSeconds(secondsRemaining);

            s += "Bible\n";
            s += "Words Count: " + GetFormattedNumber(BibleWords) + "\n";
            s += "Words Read: " + GetFormattedNumber(User.Field <int>("ReadWordCount")) + "\n";
            s += "Words Remaining: " + GetFormattedNumber(wordsRemaining) + "\n";
            s += string.Format("Chapters Remaining: \n");
            s += string.Format("Verses Remaining: \n");

            // http://stackoverflow.com/questions/463642/what-is-the-best-way-to-convert-seconds-into-hourminutessecondsmilliseconds
            s += string.Format("ETF: {0}\n", GetFormattedTime(timeToFinish));

            s += "\n";
            s += "Old Testament:\n";

            s += "\n";
            s += "New Testament:\n";

            wordsRemaining =
                Books.AsEnumerable()
                .First(p => p.Field <int>("BookId") == CurrentVerse.Field <int>("BookId"))
                .Field <int>("Words") - User.Field <int>("ReadWordCount");

            secondsRemaining = 60 * wordsRemaining / User.Field <int>("WordsPerMinute");
            timeToFinish     = TimeSpan.FromSeconds(secondsRemaining);

            s += "\n";
            s += "Current Book:\n";
            s += string.Format("Words Remaining: " + GetFormattedNumber(wordsRemaining)) + "\n";
            s += GetFormattedTime(timeToFinish);

            lblStatistics.Text = s;
        }
Beispiel #3
0
        private void UpdateVerse()
        {
            lblReference.Text = string.Format("{0} {1}:{2}"
                                              , CurrentVerse.Field <string>("Name")
                                              , CurrentVerse.Field <int>("ChapterNumber")
                                              , CurrentVerse.Field <int>("VerseNumber"));


            lblVerse.Text = string.Format("{0}", CurrentVerse.Field <string>("Verse"));

            UpdateInterval();
            AdjustVerseLabelsPosition();

            //SystemSounds.Beep.Play();

            StartTimer();
        }
Beispiel #4
0
        /*
         * private void LoadPreviousBook()
         * {
         *  if ((BookEnum)CurrentBook.AsEnumerable().First().Field<int>("BookId") == BookEnum.Genesis)
         *  {
         *      LoadBook(BookEnum.Revelation);
         *      return;
         *  }
         *
         *  LoadBook((BookEnum)CurrentBook.AsEnumerable().First().Field<int>("BookId") - 1);
         *  SetCurrentVerseAsFirstOne();
         *  UpdateVerse();
         * }
         */

        private void LoadPreviousVerse()
        {
            if (!HasStarted)
            {
                return;
            }

            StopTimer();

            if (CurrentVerse.Field <int>("SequenceInBook") == 1)
            {
                return; // Não vai de Gênesis para Apocalipse
            }
            CurrentVerse = GetPreviousVerse(CurrentVerse);

            UpdateVerse();
        }
Beispiel #5
0
        private void OnFinishTime(object sender, ElapsedEventArgs e)
        {
            if (WaitForAnswer)
            {
                Player.Pause();
                StartAnswerTimer();
            }
            else if (CurrentVerseIndex == Lyrics.Count)
            {
                CurrentVerse       = string.Empty;
                LyricTimer.Enabled = false;
            }
            else
            {
                UpdateLyric();

                WaitForAnswer = CurrentVerse.Contains("*");
            }
        }