GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoView Class / MoveSelection Method
The collection of objects to be moved; if null, this view's Selection is used.
The distance the objects should be moved.
Whether to adjust the computed destination location by calling SnapPoint. This is normally true, to allow any relevant grids to decide how to control movement of objects.
In This Topic
    MoveSelection Method
    In This Topic
    Move a collection of objects by a given offset.
    Syntax
    public virtual void MoveSelection( 
       GoSelection sel,
       SizeF offset,
       bool grid
    )

    Parameters

    sel
    The collection of objects to be moved; if null, this view's Selection is used.
    offset
    The distance the objects should be moved.
    grid
    Whether to adjust the computed destination location by calling SnapPoint. This is normally true, to allow any relevant grids to decide how to control movement of objects.
    Remarks

    This method heeds the CanMoveObjects property if sel is this view's Selection, and the GoObject.CanMove predicate for each GoObject that is not an IGoLink. To accomplish the move, each object's GoObject.DoMove is called, to support object-specific move behavior. All actions take place within a GoUndoManager.MoveSelectionName transaction. This does not raise the SelectionMoved event; that event is raised by the GoToolDragging tool's DoMouseUp method. If there are any duplicates in the selection, objects may get moved multiple times. Note that an object may be moved twice if both it and one of its parents are in the selection.

    When grid is true, each of the non-link objects in the selection sel is "snapped" to the proper location, by calling SnapPoint. It is always each object's GoObject.GoObject.Location that is snapped to some point. However, links that are in the selection are never "snapped"; they are always moved by the distance that the first movable non-link object in the selection is moved, which may have been grid-snapped. This policy supports moving links without recalculating their paths, as long as their connected ports/nodes are all moved together by the same distance, whether those nodes are "snapped" or not.

    See Also