New to Telerik UI for WinFormsStart a free 30-day trial

This class is accountable for calculating snapping related transformations for position and size.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class SnappingService : GraphServiceBase, ISnappingService

Inheritance: objectGraphServiceBaseSnappingService

Implements: ISnappingService

Inherited Members GraphServiceBase.Graph

Constructors

Initializes a new instance of the SnappingService class.

C#
public SnappingService(IGraphInternal graph)
Parameters:graphIGraphInternal

The graph.

Methods

Clears after the snap action.

C#
public virtual void ClearSnap()

Implements: ISnappingService.ClearSnap()

Initializes the snap action.

C#
public virtual void InitializeSnap(IEnumerable<IShape> staticItems, IDiagramItem mainItem, bool isSnapToItemsEnabled, bool isSnapToGridEnabled, Point initialPosition)
Parameters:staticItemsIEnumerable<IShape>

The static items - the items that you don't drag at the moment.

mainItemIDiagramItem

The main item - the item that drag started from.

isSnapToItemsEnabledbool

The is snap to items enabled.

isSnapToGridEnabledbool

The is snap to grid enabled.

initialPositionPoint

The initial position.

Implements: ISnappingService.InitializeSnap(IEnumerable<IShape>, IDiagramItem, bool, bool, Point)

Changes the snapping engine.

C#
public virtual void SetSnappingEngine(SnappingEngine snappingEngine)
Parameters:snappingEngineSnappingEngine

Implements: ISnappingService.SetSnappingEngine(SnappingEngine)

Snaps the new dragging position.

C#
public virtual Point SnapItems(IEnumerable<IDiagramItem> selectedItems, Point newPosition)
Parameters:selectedItemsIEnumerable<IDiagramItem>

The selected items.

newPositionPoint

The new position.

Returns:

Point

Implements: ISnappingService.SnapItems(IEnumerable<IDiagramItem>, Point)

Snaps point.

C#
public virtual Point SnapPoint(Point point)
Parameters:pointPoint

The point to snap.

Returns:

Point

The snapped point.

Implements: ISnappingService.SnapPoint(Point)

Events

Occurs when snapping lines have been calculated.

C#
public event EventHandler<SnappingLinesCalculatedEventArgs> SnappingLinesCalculated

Implements: ISnappingService.SnappingLinesCalculated