SelectionState Class
Abstract class representing any selection state. Provides the interface for querying infomation about the specified selection, including: the ActualSelection, CoercedSelection, and weather or not a specifc command is to be filtered out for the selection.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Modeling.Diagrams.SelectionState
Microsoft.VisualStudio.Modeling.Diagrams.EmptySelection
Microsoft.VisualStudio.Modeling.Diagrams.GeneralSelection
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Syntax
'Dichiarazione
Public MustInherit Class SelectionState
public abstract class SelectionState
public ref class SelectionState abstract
[<AbstractClass>]
type SelectionState = class end
public abstract class SelectionState
The SelectionState type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SelectionState |
Top
Properties
Name | Description | |
---|---|---|
ActualSelection | Gets the actual selection. | |
CoercedSelection | Gets the coerced selection by applying coercion rules to the actual selection. NOTE: The returned value can be null. A null coercion indicates that the selection state doesn't define coercion rules (i.e. a multiple seleciton including only comment connectors is covered by the GeneralSelection state, which doesn't define any coercions rules, so the seleciton's coercion is null). If coercion rules are defined for a selection state, but the coercion fails (as would be the case for a selection including several components belonging to different zones), the coerced selection exists but is empty. These helpers can be used to demystify the results of coercing a selection: * IsCoercible - true if the seleciton can be coerced (i.e. the selection state does define coercion rules). CoercedSelection will return a collection, but it may be empty. * IsCoercionFailure - true if the actual selection can be coerced, but the coercion fails (due coercion rules.) CoercedSelection will be an empy collection. * HasCoercion - true if the actual selection is coercable and its coercion does not fail. CoercedSelection will return a non-empty collection. | |
CoercedSelectionCache | ||
CoercedSelectionModelElements | It is possible for the CoercedSelection to include Pels and Mels which are associated with Pels that are not already included. This method returns a list that replaces the Pels in the coerced selection with their associated Mels, plus any mels from the coerced selection that did not have pels. | |
CoercedSelectionPresentationElements | It is possible for the CoercedSelection to include Pels and Mels which are associated with Pels that are not already included. This method returns a collection which excludes any Mels. | |
CoercionCompliantSelection | Returns the list of selected objects which comply with the coercion rules. If the selection is coercable, then the coerced selection will be returned; if there is a coercion failure the list will be empty. If there are no coercion rules (!IsCoercable), then the actual selection is returned. | |
HasCoercion | Determines if the selection has a valid coercion. | |
IsActualSelectionMixed | True if all selected objects in the actual selection are of the same type. | |
IsCoercedSelectionMixed | True if all selected objects in the coerced selection are of the same type. | |
IsCoercible | Determines if the actual selection can be coerced. Togegher IsCoercible and IsCoercionFailure distinguish between coercion failure, and no coercion available. | |
IsCoercionFailure | Togegher IsCoercible and IsCoercionFailure distinguish between coercion failure, and no coercion available. |
Top
Methods
Name | Description | |
---|---|---|
CacheCoercedSelection | Cache the specified collection. | |
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.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IdentifyCommandsToBeFilteredOutForMultipleSelection | Override to identify the commands which are not valid in a single selection scenario, for this selection state. | |
IdentifyCommandsToBeFilteredOutForSingleSelection | Override to identify the commands which are not valid in a single selection scenario, for this selection state. | |
Initialize | specifies the actual selection to operate upon. | |
IsApplicable | True if the SelectionState appiles to the specified selection (actualSelection.) | |
IsCommandToBeFilteredOut | True if the specified command should not be enabled for this selection state. The method is evaluated for the coerced selection. | |
IsCommandToBeFilteredOutForMultipleSelection | True if the specified command should not be enabled for this selection state. The method is evaluated for the coerced selection. | |
IsCommandToBeFilteredOutForSingleSelection | True if the specified command should not be enabled for this selection state. The method is evaluated for the coerced selection. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
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.