Compartilhar via


SelectedShapesCollection Class

Definition

public ref class SelectedShapesCollection : IDisposable, System::Collections::ICollection
public class SelectedShapesCollection : IDisposable, System.Collections.ICollection
type SelectedShapesCollection = class
    interface ICollection
    interface IEnumerable
    interface IDisposable
Public Class SelectedShapesCollection
Implements ICollection, IDisposable
Inheritance
SelectedShapesCollection
Implements

Constructors

SelectedShapesCollection(DiagramClientView)

Initializes a new instance of the SelectedShapesCollection class.

Properties

AnchorItem

Gets or sets the DiagramItem that serves as the anchor for extending the selection.

BoundingBox

Gets the bounding rectangle surrounding all selected ShapeElements in world units relative to the diagram's top-left.

Count

Gets the number of ShapeElements in the selection.

EditItem

Gets the item to edit. This is typically the FocusedItem.

FocusedItem

Gets or sets the DiagramItem that has the focus.

IsDeferredSelectionPending

Gets a value indicating whether a deferred selection is pending.

IsSynchronized

Gets a value indicating whether access to the collection is synchronized (thread-safe).

PrimaryItem

Gets the primary DiagramItem in the selection.

RepresentedElements

Gets corresponding ModelElements that represent this selection.

SelectionRules

Gets the DiagramSelectionRules object that constrains how ShapeElements can be added and removed from the selection.

SyncRoot

Gets an object that can be used to synchronize access to the collection.

TopLevelItems

Gets the top level items in the selection.

Methods

Add(DiagramItem)

Adds a DiagramItem to the current selection.

Add(DiagramItemCollection)

Adds the specified DiagramItems to the current selection.

CanEditValue(DiagramClientView)

Returns a value indicating whether this DiagramItem can be edited.

Clear()

Clears the current selection.

CommitPendingEdit(DiagramClientView)

Commits the in-place edit.

Contains(DiagramItem)

Gets a value indicating whether the selection contains the specified DiagramItem.

CopyTo(Array, Int32)

Copies the ShapeElements of the selection to an Array, starting at a particular Array index.

CopyTo(DiagramItem[], Int32)

Copies the DiagramItems of the selection to a DiagramItem[] array, starting at a particular Array index.

DeferredAdd(DiagramItem)

Defers adding a DiagramItem to the selection until ElementEventsEnded is raised. The DeferredAdd, DeferredRemove, DeferredPrimaryItem, and DeferredClear methods define the parameters to use in a single call to set the selection when ElementEventsEnded is raised.

DeferredClearBeforeAdditions()

Defers clearing the selection until ElementEventsEnded is raised. This clears the selection first, and then any deferred additions or removals are applied. The DeferredAdd, DeferredRemove, DeferredPrimaryItem, and DeferredClear methods define the parameters to use in a single call to set the selection when ElementEventsEnded is raised.

DeferredPrimaryItem(DiagramItem)

Defers setting the primary item in the selection until ElementEventsEnded is raised. The DeferredAdd, DeferredRemove, DeferredPrimaryItem, and DeferredClear methods define the parameters to use in a single call to set the selection when ElementEventsEnded is raised.

DeferredRemove(DiagramItem)

Defers removing a DiagramItem from the selection until ElementEventsEnded is raised. The DeferredAdd, DeferredRemove, DeferredPrimaryItem, and DeferredClear methods define the parameters to use in a single call to set the selection when ElementEventsEnded is raised.

Dispose()
Dispose(Boolean)
EditValue(DiagramClientView)

Invoke the in-place editor for this DiagramItem.

EnsureVisible()

Ensures that the selection is within the view. If it is not, it is centered in the view. If the selection is the diagram, then nothing happens.

EnsureVisible(DiagramClientView+EnsureVisiblePreferences)

Ensures that the selection is within the view.
If the selection is the diagram, then nothing happens.

FindFirstFocusableDiagramItem(DiagramItem)

Given the specified diagram item, find the first diagram item that can receive focus. If the specified diagram item can receive focus, a clone of it is returned. If the diagram item is not focusable, then its first focusable descendant is returned, if any. If that search fails, then the parent hierarchy is traversed for the first focusable ancestor.

FindFirstSelectableDiagramItem(DiagramItem)

Given the specified diagram item, find the first selectable diagram item. If the specified diagram item is selectable, a clone of it is returned. If the diagram item is not selectable, then the parent hierarchy is traversed for the first selectable ancestor.

GetDiagramItemsContainingShape(ShapeElement)

Gets a collection of diagram items in the selection whose Shape property is the specified shape.

GetEnumerator()

Returns an enumerator that can iterate through the DiagramItem collection.

HasPendingEdit(DiagramClientView)

Returns a value indicating whether in-place editing is active.

OnSelectionChangedByDeletion(DiagramItemEventArgs)

Raises the SelectionChangedByDeletion event.

OnShapeSelectionChanged(EventArgs)
OnShapeSelectionChanging(EventArgs)
Remove(DiagramItem)

Removes a DiagramItem from the current selection.

Remove(DiagramItemCollection)

Removes the specified DiagramItems from the current selection.

SelectFocusedItemOrAncestor()

Selects the currently focused item in the selection (which may or may not be selected). If it is not selectable, the parent chain will be searched for the first selectable ancestor. The focused item remains unchanged.

Set(DiagramItem)

Replaces the current selection with a new single selection.

Set(DiagramItemCollection)

Replaces the current selection with a new selection.

SetDeferredSelection()

Sets the selection using the information gathered from DeferredAdd, DeferredRemove, DeferredPrimaryItem, and DeferredClear. If no deferred information is available, then this method does nothing. This method is intended to be called only during OnElementEventsEnded.

Toggle(DiagramItem)

Toggles the specified DiagramItem into or out of the selection; i.e., if the DiagramItem is selected, it is deselected. If the DiagramItem is not selected, it is selected.

Toggle(DiagramItemCollection)

Toggles the specified DiagramItems into or out of the selection; i.e., if a DiagramItem is selected, it is deselected. If a DiagramItem is not selected, it is selected.

Events

SelectionChangedByDeletion

Occurs when the selection is about to change because a ModelElement that an item in the selection refers to has been deleted.

ShapeSelectionChanged

Occurs when the selection has changed.

ShapeSelectionChanging

Occurs when the selection is about to change.

Applies to