Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
        public void Select(int index)
        {
            CheckSize(true);
            IShape shape = ShapesPrivate.Select(index);

            GhostPrivate       = shape.GetGhost();
            GhostPrivate.State = GhostState.Modity;
            RedrawCore();
        }
Esempio n. 3
0
        private void AddImpl(IShape shape)
        {
            if (shape == null)
            {
                return;
            }
            //增加文本形状时交互
            if (shape is LabelShape)
            {
                PreLabelModify(shape);
            }

            shape.Data.Enable = true;
            ShapesPrivate.Add(shape);
            DrawShapeCore(shape);
        }
Esempio n. 4
0
 public void Remove()
 {
     CheckSize(true);
     ShapesPrivate.RemoveAt(ShapesPrivate.Count - 1);
     RedrawCore();
 }