/// <summary>
        /// Writes text to the console.
        /// </summary>
        public void Write(string text, Style style)
        {
            Debug.WriteLine("PythonConsole.Write(text, style): " + text);
            if (style == Style.Error)
            {
                textEditor.Write(text, Color.Red, Color.White);
            }
            else if (style == Style.Warning)
            {
                textEditor.Write(text, Color.Yellow, Color.Black);
            }
            else
            {
                textEditor.Write(text);
            }

            if (style == Style.Prompt)
            {
                promptLength = text.Length;
                textEditor.MakeCurrentContentReadOnly();
            }

            //HACK: This seems to be the safest point which to inject our Host Application
            if (!bHostAppInitialized && this.commandLine.ScriptScope != null)
            {
                this.commandLine.ScriptScope.SetVariable(ScriptGlobals.HostApp, new HostApplication());
                bHostAppInitialized = true;
            }
        }
示例#2
0
        public void Write(string text, Style style)
        {
            textEditor.Write(text);

            if (style == Style.Prompt)
            {
                promptLength = text.Length;
                textEditor.MakeCurrentContentReadOnly();
            }
        }
示例#3
0
        /// <summary>
        /// Writes text to the console.
        /// </summary>
        public void Write(string text, Style style)
        {
            Console.WriteLine("PythonConsole.Write(text, style): " + text);

            textEditor.Write(text);

            if (style == Style.Prompt)
            {
                promptLength = text.Length;
                textEditor.MakeCurrentContentReadOnly();
            }
        }