Пример #1
0
        public void PerformAction(VTActions vtAction, params object[] param)
        {
            switch (vtAction)
            {
            case VTActions.Print:
            {
                string text = param[0].ToString();

                this.currentLine.AppendText(text);
                this.currentLine.PerformRender();

                break;
            }

            case VTActions.CarriageReturn:
            {
                break;
            }

            case VTActions.LineFeed:
            {
                this.currentLine = this.RenderLine(string.Empty);
                break;
            }

            default:
                logger.WarnFormat("未处理的VTAction, {0}", vtAction);
                break;
            }
        }
Пример #2
0
        public static TerminalLine Render(double offsetX, double offsetY, string text)
        {
            TerminalLine termLine = TerminalLineFactory.Create(offsetX, offsetY, text);

            termLine.PerformRender();
            return(termLine);
        }
Пример #3
0
        /// <summary>
        /// 创建一个新的行,然后渲染,最后返回
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        private TerminalLine RenderLine(string text)
        {
            TerminalLine line = TerminalLineFactory.Render(0, this.linesHeight, text);

            this.termLines.Add(line);
            this.visualList.Add(line);

            this.linesHeight += line.Height;

            return(line);
        }
Пример #4
0
        private void InitializeContainer()
        {
            this.termLines = new List <TerminalLine>();
            this.termCaret = new TerminalCaret();

            this.visualList = new VisualCollection(this);
            this.visualList.Add(this.termCaret);

            this.currentLine = this.RenderLine(string.Empty);

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                //this.InitializeBlinkThread();
            }
        }
Пример #5
0
        public static TerminalLine Create(double offsetX, double offsetY, string text)
        {
            TerminalLine termLine = new TerminalLine(offsetX, offsetY, text);

            return(termLine);
        }