示例#1
0
        private void ProgramInteraction_Input(object sender, InputEventArgs e)
        {
            // The user has sumbitted an answer to the interactive input prompt
            // So hide the input box
            ProgramInteraction.HideInputPrompt();

            // Show the original prompt (if any)
            if (!string.IsNullOrWhiteSpace(runner.Prompt))
            {
                ProgramInteraction.OutputText(runner.Prompt.Trim() + " ");
            }

            // Show the user's response
            ProgramInteraction.OutputText(e.Answer + Environment.NewLine);

            // Submit the user's answer to the Python program, so it can continue
            runner.SubmitInput(e.Answer);
        }
示例#2
0
 private void Runner_OutputReceived(object sender, RunnerOutputEventArgs e)
 {
     App.Current.Dispatcher.Invoke(() => ProgramInteraction.OutputText(e.Text));
 }