Ejemplo n.º 1
0
        void StopGo(Foundation.NSObject sender)
        {
            ResetElapsedTime();
            if (Timer == null)
            {
                Timer          = new Timer(100);
                Timer.Elapsed += timer_Elapsed;
                Timer.Start();
//				colorTextField.Enabled = false;
//				colorWell.Enabled = false;
//				segControl.Enabled = false;
                CorrectLetters           = 0;
                IncorrectLetters         = 0;
                lblCorrect.StringValue   = CorrectLetters.ToString();
                lblIncorrect.StringValue = IncorrectLetters.ToString();
            }
            else
            {
                Timer.Stop();
                Timer.Elapsed -= timer_Elapsed;
                Timer          = null;
//				colorTextField.Enabled = true;
//				colorWell.Enabled = true;
//				segControl.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            progressBar.MaxValue    = (double)timeLimit;
            progressBar.DoubleValue = 0;

            if (Sentences)
            {
                // Sentences
                NextSentence();
                ShowNextLetter();
            }
            else
            {
                // Random Letters;
                ShowAnotherLetter();
            }

            inLetterView.SetValueForKey(userSelectedBgColor, new NSString("BgColor"));
            outLetterView.SetValueForKey(userSelectedBgColor, new NSString("BgColor"));
            CorrectLetters           = 0;
            IncorrectLetters         = 0;
            lblCorrect.StringValue   = CorrectLetters.ToString();
            lblIncorrect.StringValue = IncorrectLetters.ToString();

            colorTextField.EditingEnded += (object sender, EventArgs e) => {
                userSelectedBgColor   = colorWell.Color;
                outLetterView.BgColor = colorWell.Color;
            };

            // ColorWell has issues too, but harder to reproduce. Crash log in notepad, Xamarin folder -> Scratchpad
            colorWell.Activated += (object sender, EventArgs e) => {
                userSelectedBgColor   = colorWell.Color;
                outLetterView.BgColor = colorWell.Color;
            };

            // Native crash - file bug report. go back and forth to repro, especially while running the typing tutor, or going back to "Random Letters
            // after stopping. rfe
            segControl.Activated += (object sender, EventArgs e) => {
                Sentences = segControl.SelectedSegment == 1;
                if (Sentences)
                {
                    // Sentences
                    NextSentence();
                    ShowNextLetter();
                }
                else
                {
                    // Random Letters;
                    ShowAnotherLetter();
                }
            };
        }