共用方式為


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
Public method SelectedShapesCollection Initializes a new instance of the SelectedShapesCollection class.

Top

Properties

  Name Description
Public property AnchorItem Gets or sets the DiagramItem that serves as the anchor for extending the selection.
Public property BoundingBox Gets the bounding rectangle surrounding all selected ShapeElements in world units relative to the diagram's top-left.
Public property Count Gets the number of ShapeElements in the selection.
Public property EditItem Gets the item to edit. This is typically the FocusedItem.
Public property FocusedItem Gets or sets the DiagramItem that has the focus.
Public property IsDeferredSelectionPending Gets a value indicating whether a deferred selection is pending.
Public property IsSynchronized Gets a value indicating whether access to the collection is synchronized (thread-safe).
Public property PrimaryItem Gets the primary DiagramItem in the selection.
Public property RepresentedElements Gets corresponding ModelElements that represent this selection.
Public property SelectionRules Gets the DiagramSelectionRules object that constrains how ShapeElements can be added and removed from the selection.
Public property SyncRoot Gets an object that can be used to synchronize access to the collection.
Public property TopLevelItems Gets the top level items in the selection.

Top

Methods

  Name Description
Public method Add(DiagramItem) Adds a DiagramItem to the current selection.
Public method Add(DiagramItemCollection) Adds the specified DiagramItems to the current selection.
Public method CanEditValue Returns a value indicating whether this DiagramItem can be edited.
Public method Clear Clears the current selection.
Public method CommitPendingEdit Commits the in-place edit.
Public method Contains Gets a value indicating whether the selection contains the specified DiagramItem.
Public method CopyTo(Array, Int32) Copies the ShapeElements of the selection to an Array, starting at a particular Array index.
Public method CopyTo(array<DiagramItem[], Int32) Copies the DiagramItems of the selection to a DiagramItem[] array, starting at a particular Array index.
Public method 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.
Public method 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.
Public method 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.
Public method 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.
Public method Dispose() Releases all resources used by the current instance of the SelectedShapesCollection class.
Protected method Dispose(Boolean)
Public method EditValue Invoke the in-place editor for this DiagramItem.
Public method 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.
Public method EnsureVisible(DiagramClientView.EnsureVisiblePreferences) Ensures that the selection is within the view. If the selection is the diagram, then nothing happens.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic member 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.
Public methodStatic member 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.
Public method GetDiagramItemsContainingShape Gets a collection of diagram items in the selection whose Shape property is the specified shape.
Public method GetEnumerator Returns an enumerator that can iterate through the DiagramItem collection.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method HasPendingEdit Returns a value indicating whether in-place editing is active.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnSelectionChangedByDeletion Raises the SelectionChangedByDeletion event.
Protected method OnShapeSelectionChanged
Protected method OnShapeSelectionChanging
Public method Remove(DiagramItem) Removes a DiagramItem from the current selection.
Public method Remove(DiagramItemCollection) Removes the specified DiagramItems from the current selection.
Public method 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.
Public method Set(DiagramItem) Replaces the current selection with a new single selection.
Public method Set(DiagramItemCollection) Replaces the current selection with a new selection.
Public method 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.
Public method 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.
Public method 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.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event SelectionChangedByDeletion Occurs when the selection is about to change because a ModelElement that an item in the selection refers to has been deleted.
Public event ShapeSelectionChanged Occurs when the selection has changed.
Public event 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.

See Also

Reference

Microsoft.VisualStudio.Modeling.Diagrams Namespace