예제 #1
0
 public void AddRange(ShapeCollection shapes)
 {
     foreach (IShape current in shapes)
     {
         base.Add(current);
     }
 }
예제 #2
0
파일: Select.cs 프로젝트: code-mtnit/WPFSM
        protected HitPositions SelectShape(ShapeCollection shapes, Point point)
        {
            if (Control.ModifierKeys != Keys.Control)
            {
                Select.UnselectAll(shapes);
            }
            HitPositions result;

            for (int i = shapes.Count - 1; i >= 0; i--)
            {
                IShape       shape        = shapes[i];
                HitPositions hitPositions = shape.HitTest(point);
                if (hitPositions != HitPositions.None)
                {
                    if (!shape.Locked)
                    {
                        shapes.BringToFront(shape);
                        shape.Selected            = true;
                        Select._lastSelectedShape = shape;
                    }
                    result = hitPositions;
                    return(result);
                }
            }
            result = HitPositions.None;
            return(result);
        }
예제 #3
0
파일: Select.cs 프로젝트: code-mtnit/WPFSM
 public static void UnselectAll(ShapeCollection shapes)
 {
     foreach (IShape current in shapes)
     {
         current.Selected = false;
     }
 }
예제 #4
0
        public virtual object Clone()
        {
            ShapeCollection shapeCollection = new ShapeCollection();

            foreach (IShape current in this)
            {
                shapeCollection.Add(current.Clone() as IShape);
            }
            return(shapeCollection);
        }
예제 #5
0
파일: Select.cs 프로젝트: code-mtnit/WPFSM
        public static ShapeCollection GetSelectedShapes(ShapeCollection shapes)
        {
            ShapeCollection shapeCollection = new ShapeCollection();

            foreach (IShape current in shapes)
            {
                if (current.Selected)
                {
                    shapeCollection.Add(current);
                }
            }
            return(shapeCollection);
        }
예제 #6
0
 public void SnapToGrid(ShapeCollection shapes)
 {
     foreach (IShape current in shapes)
     {
         bool selected = current.Selected;
         bool locked   = current.Locked;
         current.Selected  = true;
         current.Locked    = false;
         current.Location  = this.GetRoundedPoint(current.Location);
         current.Dimension = this.GetRoundedSize(current.Dimension);
         current.Selected  = selected;
         current.Locked    = locked;
     }
 }
예제 #7
0
 public static object[] ToObjects(ShapeCollection shapes)
 {
     object[] result;
     if (shapes.Count == 0)
     {
         result = null;
     }
     else
     {
         object[] array = new object[shapes.Count];
         for (int i = 0; i < shapes.Count; i++)
         {
             array[i] = shapes[i];
         }
         result = array;
     }
     return(result);
 }
예제 #8
0
 public virtual bool UpdateCursor(IDocument document, ShapeCollection shapes, Point point)
 {
     return(false);
 }