我是学生,我在这里很新.我有一个课程项目来制作类似Paint的程序.我有一个基类Shape与DrawSelf,包含等.现在,Rectangle,Ellipse和Triangle的方法和类.此外,我有两个其他类的DisplayProccesor,它是绘图类,DialogProcessor,它控制与用户的对话.Theese是该项目的要求.
public class DisplayProcessor
{
public DisplayProcessor()
{
}
/// <summary>
/// List of shapes
/// </summary>
private List<Shape> shapeList = new List<Shape>();
public List<Shape> ShapeList
{
get { return shapeList; }
set { shapeList = value; }
}
/// <summary>
/// Redraws all shapes in shapeList
/// </summary>
public void ReDraw(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
Draw(e.Graphics);
}
public virtual void Draw(Graphics grfx)
{
int n = shapeList.Count;
Shape shape;
for …Run Code Online (Sandbox Code Playgroud)