public void Deselect() { CheckSize(true); if (GhostPrivate != null) { IShape shape = GhostPrivate.Shape; if (shape != null && shape.Data != null && shape.Data.Points != null) { if (!shape.Completed && shape.Data.Points.Length >= shape.MinPoints && shape.Data.Points.Length <= shape.MaxPoints) { shape.Complete(); } } ShapesPrivate.Deselect(GhostPrivate.Shape); // careful: not same instance GhostPrivate.Shape.Data.IsBackground = true; DrawShapeCore(GhostPrivate.Shape); GhostPrivate = NotAvailableGhost.Instance; OnCurrentChanged(EventArgs.Empty); } }
public void Select(int index) { CheckSize(true); IShape shape = ShapesPrivate.Select(index); GhostPrivate = shape.GetGhost(); GhostPrivate.State = GhostState.Modity; RedrawCore(); }
private void AddImpl(IShape shape) { if (shape == null) { return; } //增加文本形状时交互 if (shape is LabelShape) { PreLabelModify(shape); } shape.Data.Enable = true; ShapesPrivate.Add(shape); DrawShapeCore(shape); }
public void Remove() { CheckSize(true); ShapesPrivate.RemoveAt(ShapesPrivate.Count - 1); RedrawCore(); }