Class
SelectionService

Manages the selection of diagram entities.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class SelectionService : ISelectionService<IDiagramItem>

Inheritance: objectSelectionService

Implements: ISelectionService<IDiagramItem>

Constructors

SelectionService()

Initializes a new instance of the SelectionService class.

Declaration

cs-api-definition
public SelectionService()

Properties

SelectedConnections

Gets the selected connections.

Declaration

cs-api-definition
public IEnumerable<IConnection> SelectedConnections { get; }

Property Value

IEnumerable<IConnection>

The selected connections.

Implements ISelectionService<IDiagramItem>.SelectedConnections

SelectedItems

Gets the currently selected diagram entities.

Declaration

cs-api-definition
public IEnumerable<IDiagramItem> SelectedItems { get; }

Property Value

IEnumerable<IDiagramItem>

Implements ISelectionService<IDiagramItem>.SelectedItems

SelectedItemsCount

Gets the selected items count.

Declaration

cs-api-definition
public int SelectedItemsCount { get; }

Property Value

int

Implements ISelectionService<IDiagramItem>.SelectedItemsCount

SelectedShapes

Gets the currently selected diagram shapes.

Declaration

cs-api-definition
public IEnumerable<IShape> SelectedShapes { get; }

Property Value

IEnumerable<IShape>

Implements ISelectionService<IDiagramItem>.SelectedShapes

Methods

ClearSelection()

Clears the selection.

Declaration

cs-api-definition
public virtual void ClearSelection()

Implements ISelectionService<IDiagramItem>.ClearSelection()

DeselectItem(IDiagramItem)

Deselects the item.

Declaration

cs-api-definition
public virtual void DeselectItem(IDiagramItem item)

Parameters

item

IDiagramItem

The item.

Implements ISelectionService<IDiagramItem>.DeselectItem(IDiagramItem)

DeselectItems(IEnumerable<IDiagramItem>)

Deselects the items.

Declaration

cs-api-definition
public virtual void DeselectItems(IEnumerable<IDiagramItem> items)

Parameters

items

IEnumerable<IDiagramItem>

The items.

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

GetSelectionBounds(bool, bool)

Recalculates the selection bounding box.

Declaration

cs-api-definition
public Rect GetSelectionBounds(bool isGraphVirtualized = false, bool actualBounds = false)

Parameters

isGraphVirtualized

bool

actualBounds

bool

Returns

Rect

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

IsSingleSelected(IDiagramItem)

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

Declaration

cs-api-definition
public bool IsSingleSelected(IDiagramItem item)

Parameters

item

IDiagramItem

The item.

Returns

bool

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

Implements ISelectionService<IDiagramItem>.IsSingleSelected(IDiagramItem)

SelectItem(IDiagramItem, bool)

Selects the given item.

Declaration

cs-api-definition
public virtual void SelectItem(IDiagramItem item, bool addToExistingSelection = false)

Parameters

item

IDiagramItem

The item.

addToExistingSelection

bool

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

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

SelectItems(IEnumerable<IDiagramItem>, bool)

Selects the given items.

Declaration

cs-api-definition
public virtual void SelectItems(IEnumerable<IDiagramItem> items, bool addToExistingSelection = false)

Parameters

items

IEnumerable<IDiagramItem>

The items to select.

addToExistingSelection

bool

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

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

SelectNextItem(IList<IDiagramItem>, bool)

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

Declaration

cs-api-definition
public void SelectNextItem(IList<IDiagramItem> orderedItems, bool moveBackward)

Parameters

orderedItems

IList<IDiagramItem>

moveBackward

bool

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

SyncSelectedItems(IDiagramItem)

Syncs the selected items.

Declaration

cs-api-definition
public bool SyncSelectedItems(IDiagramItem model)

Parameters

model

IDiagramItem

The model.

Returns

bool

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

Implements ISelectionService<IDiagramItem>.SyncSelectedItems(IDiagramItem)

Events

PreviewSelectionChanged

Occurs when [selection starts].

Declaration

cs-api-definition
public event EventHandler<DiagramSelectionChangedEventArgs> PreviewSelectionChanged

Event Value

EventHandler<DiagramSelectionChangedEventArgs>

Implements ISelectionService<IDiagramItem>.PreviewSelectionChanged

SelectionChanged

Occurs when [selection ended].

Declaration

cs-api-definition
public event EventHandler<DiagramSelectionChangedEventArgs> SelectionChanged

Event Value

EventHandler<DiagramSelectionChangedEventArgs>

Implements ISelectionService<IDiagramItem>.SelectionChanged