SelectedShapesCollection Class
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Modeling.Diagrams.SelectedShapesCollection
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Syntax
'宣告
Public Class SelectedShapesCollection _
Implements ICollection, IEnumerable, IDisposable
public class SelectedShapesCollection : ICollection,
IEnumerable, IDisposable
public ref class SelectedShapesCollection : ICollection,
IEnumerable, IDisposable
type SelectedShapesCollection =
class
interface ICollection
interface IEnumerable
interface IDisposable
end
public class SelectedShapesCollection implements ICollection, IEnumerable, IDisposable
The SelectedShapesCollection type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SelectedShapesCollection | Initializes a new instance of the SelectedShapesCollection class. |
Top
Properties
Name | Description | |
---|---|---|
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. |
Top
Methods
Name | Description | |
---|---|---|
Add(DiagramItem) | Adds a DiagramItem to the current selection. | |
Add(DiagramItemCollection) | Adds the specified DiagramItems to the current selection. | |
CanEditValue | Returns a value indicating whether this DiagramItem can be edited. | |
Clear | Clears the current selection. | |
CommitPendingEdit | Commits the in-place edit. | |
Contains | 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(array<DiagramItem[], Int32) | Copies the DiagramItems of the selection to a DiagramItem[] array, starting at a particular Array index. | |
DeferredAdd | 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 | 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 | 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() | Releases all resources used by the current instance of the SelectedShapesCollection class. | |
Dispose(Boolean) | ||
EditValue | 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. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FindFirstFocusableDiagramItem | 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 | 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 | 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. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasPendingEdit | Returns a value indicating whether in-place editing is active. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnSelectionChangedByDeletion | Raises the SelectionChangedByDeletion event. | |
OnShapeSelectionChanged | ||
OnShapeSelectionChanging | ||
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. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
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. |
Top
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.