public void AddRange(ShapeCollection shapes) { foreach (IShape current in shapes) { base.Add(current); } }
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); }
public static void UnselectAll(ShapeCollection shapes) { foreach (IShape current in shapes) { current.Selected = false; } }
public virtual object Clone() { ShapeCollection shapeCollection = new ShapeCollection(); foreach (IShape current in this) { shapeCollection.Add(current.Clone() as IShape); } return(shapeCollection); }
public static ShapeCollection GetSelectedShapes(ShapeCollection shapes) { ShapeCollection shapeCollection = new ShapeCollection(); foreach (IShape current in shapes) { if (current.Selected) { shapeCollection.Add(current); } } return(shapeCollection); }
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; } }
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); }
public virtual bool UpdateCursor(IDocument document, ShapeCollection shapes, Point point) { return(false); }