SelectionTypes 枚举

定义

定义用于指示选择类型的标识符。Defines identifiers that indicate the type of a selection.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class SelectionTypes
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum SelectionTypes
type SelectionTypes = 
Public Enum SelectionTypes
继承
SelectionTypes
属性

字段

Add 64

表示添加所选内容,它向当前所选内容中添加选择的组件,以保持当前选定组件的集合。Represents an add selection that adds the selected components to the current selection, maintaining the current set of selected components.

Auto 1

表示常规选择。Represents a regular selection. 此选择服务对 Ctrl 和 Shift 键作出响应,以支持在所选内容中添加或移除组件。The selection service responds to the CTRL and SHIFT keys to support adding or removing components to or from the selection.

Click 16

表示当用户单击组件时发生的选择。Represents a selection that occurs when a user clicks a component. 如果新选择的组件已被选定,则将该组件提升为主选定组件,而不是取消选择。If the newly selected component is already selected, it is promoted to be the primary selected component rather than being canceled.

MouseDown 4

表示当鼠标指针位于组件上时,用户按下鼠标按钮所发生的选择。Represents a selection that occurs when the user presses on the mouse button while the mouse pointer is over a component. 如果已选定指针下的组件,则将该组件提升为主选定组件,而不是取消选择。If the component under the pointer is already selected, it is promoted to become the primary selected component rather than being canceled.

MouseUp 8

表示选定组件后用户立即释放鼠标按钮时发生的选择。Represents a selection that occurs when the user releases the mouse button immediately after a component has been selected. 如果新选择的组件已被选定,则将该组件提升为主选定组件,而不是取消选择。If the newly selected component is already selected, it is promoted to be the primary selected component rather than being canceled.

Normal 1

表示常规选择。Represents a regular selection. 此选择服务对 Ctrl 和 Shift 键作出响应,以支持在所选内容中添加或移除组件。The selection service responds to the CTRL and SHIFT keys to support adding or removing components to or from the selection.

Primary 16

表示当用户单击组件时发生的主选择。Represents a primary selection that occurs when a user clicks on a component. 如果所选内容列表中的组件已被选定,则将该组件提升为主所选内容。If a component in the selection list is already selected, the component is promoted to be the primary selection.

Remove 128

表示移除所选内容,它从当前所选内容中移除选择的组件,以保持当前选定组件的集合。Represents a remove selection that removes the selected components from the current selection, maintaining the current set of selected components.

Replace 2

表示当选择的内容被替换时发生的选择。Represents a selection that occurs when the content of a selection is replaced. 此选择服务用替换内容替换当前选定的内容。The selection service replaces the current selection with the replacement.

Toggle 32

表示切换所选内容,它在当前所选内容与所提供的所选内容之间切换。Represents a toggle selection that switches between the current selection and the provided selection. 如果组件已被选定并且以选择类型 SetSelectedComponents 传入 Toggle,则该组件选择将被取消。If a component is already selected and is passed into SetSelectedComponents with a selection type of Toggle, the component selection will be canceled.

Valid 31

将有效选择类型标识为 NormalReplaceMouseDownMouseUpClickIdentifies the valid selection types as Normal, Replace, MouseDown, MouseUp, or Click.

注解

设计器文档的组件可以使用 ISelectionServiceSetSelectedComponents 方法进行选择。Components of a designer document can be selected using the SetSelectedComponents method of the ISelectionService. 某些类型的操作可以对所选的一个或一组组件执行操作。Some types of actions can operate on a selected component or group of selected components. ISelectionService 跟踪当前所选内容的选择类型。The ISelectionService keeps track of the selection type of the current selection. 这些选择类型标识符指示选择是使用单击、鼠标按下还是鼠标按下选择、选择是替换以前的选定内容还是使用默认的选择模式。These selection type identifiers indicate whether the selection was completed using a single click, a mouse down or mouse up selection, whether the selection should replace the previous selection, or use the default selection mode.

使用 SetSelectedComponents 方法设置新选择时,使用 SelectionTypes 枚举指定选定内容的类型。Use the SelectionTypes enumeration to specify the type of a selection when setting a new selection using the SetSelectedComponents method.

适用于

另请参阅