using Io.Github.Kerwinxu.LibShapes.Core.Shape; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Io.Github.Kerwinxu.LibShapes.Core.Command { /// /// 形状方面的命令。 /// public abstract class ShapeCommand: ICommand { /// /// 原先的形状 /// public ShapeEle OldShape { get; set; } /// /// 新的形状 /// public ShapeEle NewShape { get; set; } /// /// 画布 /// public UserControlCanvas canvas { get; set; } // 如下是两个操作。 public virtual void Undo() { this.canvas.shapes.replaceShape(this.OldShape.ID, this.NewShape); } public virtual void Redo() { this.canvas.shapes.replaceShape(this.OldShape.ID, this.OldShape); } } }