graphicalobject.cs

来自「Data Structures and Algorithms with Obj」· CS 代码 · 共 40 行

CS
40
字号
namespace Opus6
{
    using System;

    [Copyright("Copyright (c) 2001 by Bruno R. Preiss, P.Eng."), Version("$Id: GraphicalObject.cs,v 1.4 2001/10/28 19:50:09 brpreiss Exp $")]
    public abstract class GraphicalObject : GraphicsPrimitives
    {
        public GraphicalObject(Point p)
        {
            this.center = p;
        }

        public abstract void Draw();
        public virtual void Erase()
        {
            this.SetPenColor(0);
            this.Draw();
            this.SetPenColor(1);
        }

        public virtual void MoveTo(Point p)
        {
            this.Erase();
            this.center = p;
            this.Draw();
        }

        public virtual void SetPenColor(int color)
        {
            throw new MethodNotImplementedException();
        }


        public const int BACKGROUND_COLOR = 0;
        protected Point center;
        public const int FOREGROUND_COLOR = 1;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?