Пример #1
0
        /// <summary>
        /// 响应重绘事件
        /// </summary>
        private void OnPaint(XPaintEventArgs args)
        {
            PaintEventHandler <XPaintEventArgs> temp = m_paint;

            if (temp != null)
            {
                temp(args);
            }
        }
Пример #2
0
 /// <summary>
 /// 游戏重绘
 /// </summary>
 /// <param name="args"></param>
 protected virtual void GameRedraw(XPaintEventArgs args)
 {
     // 默认方法是使用背景色擦除指定区域
     m_draw.SetDrawSymbol(XSymbol.DEFAULT);
     m_draw.FillRect(args.GetClientRect(), Console.BackgroundColor);
 }
Пример #3
0
        /// <summary>
        /// 画面更新,需要重绘指定区域
        /// </summary>
        /// <param name="rect"></param>
        protected void Update(XRect rect)
        {
            XPaintEventArgs args = new XPaintEventArgs(rect, GetDraw());

            this.OnPaint(args);
        }
Пример #4
0
        /// <summary>
        /// 画面更新,需要重绘整个工作区
        /// </summary>
        protected void Update()
        {
            XPaintEventArgs args = new XPaintEventArgs(GetClientRect(), GetDraw());

            this.OnPaint(args);
        }