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

Manages the selection of diagram entities.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class SelectionService : ISelectionService<IDiagramItem>

Inheritance: objectSelectionService

Implements: ISelectionService<IDiagramItem>

Constructors

Initializes a new instance of the SelectionService class.

C#
public SelectionService()

Properties

Gets the selected connections.

C#
public IEnumerable<IConnection> SelectedConnections { get; }
Property Value:

The selected connections.

Implements: ISelectionService<IDiagramItem>.SelectedConnections

Gets the currently selected diagram entities.

C#
public IEnumerable<IDiagramItem> SelectedItems { get; }

Implements: ISelectionService<IDiagramItem>.SelectedItems

Gets the selected items count.

C#
public int SelectedItemsCount { get; }

Implements: ISelectionService<IDiagramItem>.SelectedItemsCount

Gets the currently selected diagram shapes.

C#
public IEnumerable<IShape> SelectedShapes { get; }

Implements: ISelectionService<IDiagramItem>.SelectedShapes

Methods

Clears the selection.

C#
public virtual void ClearSelection()

Implements: ISelectionService<IDiagramItem>.ClearSelection()

Deselects the item.

C#
public virtual void DeselectItem(IDiagramItem item)
Parameters:itemIDiagramItem

The item.

Implements: ISelectionService<IDiagramItem>.DeselectItem(IDiagramItem)

Deselects the items.

C#
public virtual void DeselectItems(IEnumerable<IDiagramItem> items)
Parameters:itemsIEnumerable<IDiagramItem>

The items.

Implements: ISelectionService<IDiagramItem>.DeselectItems(IEnumerable<IDiagramItem>)

Recalculates the selection bounding box.

C#
public Rect GetSelectionBounds(bool isGraphVirtualized = false, bool actualBounds = false)
Parameters:isGraphVirtualizedboolactualBoundsboolReturns:

Rect

Implements: ISelectionService<IDiagramItem>.GetSelectionBounds(bool, bool)

Determines whether [is single selected] [the specified item].

C#
public bool IsSingleSelected(IDiagramItem item)
Parameters:itemIDiagramItem

The item.

Returns:

bool

true if [is single selected] [the specified item]; otherwise, false.

Implements: ISelectionService<IDiagramItem>.IsSingleSelected(IDiagramItem)

Selects the given item.

C#
public virtual void SelectItem(IDiagramItem item, bool addToExistingSelection = false)
Parameters:itemIDiagramItem

The item.

addToExistingSelectionbool

If set to true the current selection will be expanded with the given items.

Implements: ISelectionService<IDiagramItem>.SelectItem(IDiagramItem, bool)

Selects the given items.

C#
public virtual void SelectItems(IEnumerable<IDiagramItem> items, bool addToExistingSelection = false)
Parameters:itemsIEnumerable<IDiagramItem>

The items to select.

addToExistingSelectionbool

If set to true the current selection will be expanded with the given items.

Implements: ISelectionService<IDiagramItem>.SelectItems(IEnumerable<IDiagramItem>, bool)

Selects the next item in an ordered collection based on the current selected items.

C#
public void SelectNextItem(IList<IDiagramItem> orderedItems, bool moveBackward)
Parameters:orderedItemsIList<IDiagramItem>moveBackwardbool

Implements: ISelectionService<IDiagramItem>.SelectNextItem(IList<IDiagramItem>, bool)

Syncs the selected items.

C#
public bool SyncSelectedItems(IDiagramItem model)
Parameters:modelIDiagramItem

The model.

Returns:

bool

True if item is added or removed from selectedItems, otherwise false.

Implements: ISelectionService<IDiagramItem>.SyncSelectedItems(IDiagramItem)

Events

Occurs when [selection starts].

C#
public event EventHandler<DiagramSelectionChangedEventArgs> PreviewSelectionChanged

Implements: ISelectionService<IDiagramItem>.PreviewSelectionChanged

Occurs when [selection ended].

C#
public event EventHandler<DiagramSelectionChangedEventArgs> SelectionChanged

Implements: ISelectionService<IDiagramItem>.SelectionChanged