Ejemplo n.º 1
0
        private void cmdMainTestOptions_Click(object sender, EventArgs e)
        {
            string text;

            var prompt = new TestForm(_engine);
            if(!prompt.PromptForText(this, "Enter the desired text:", out text))
                return;
            _testData = text;
        }
Ejemplo n.º 2
0
        void EngineHook(object sender, EngineEventArgs e)
        {
            switch(e.Event) {
            case EngineEvent.NapStart:
                cmdClose.Text = Strings.NapStopPreGrace;
                _secondsTimer.Enabled = true;
                SecondsTick(_secondsTimer, EventArgs.Empty);  // Display initial time
                break;

            case EngineEvent.GracePeriodOver:
                cmdClose.Text = Strings.NapStopPostGrace;
                break;

            case EngineEvent.NapElapsed: {
                if(_testMethod == TestMethod.None)
                    break;  // Just wait for the user to press the close button

                // Otherwise, hand control to the test form which will test the user
                _okToClose = true;
                Close();
                var test = new TestForm(_engine);
                test.DoTest(this.Owner, _testMethod, _testData);
                break;
            }}
        }