HitTestLocations 枚举



此 API 现已过时。

描述包含传递到 HitTest(Point) 方法的点的设计器区域。Describes the area of the designer that contains the point passed to a HitTest(Point) method.

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

public enum class HitTestLocations
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public enum HitTestLocations
type HitTestLocations = 
Public Enum HitTestLocations


ActionArea 2

指示点击了展开按钮包含的区域。Indicates the area contained by the expand button was hit.

Bottom 32

指示点击了设计器的底部。Indicates that the bottom of the designer was hit.

Connector 64

指示点击了设计器上的连接器。Indicates that a connector on the designer was hit.

Designer 1

指示点击了设计器的任何部分。Indicates that any part of the designer was hit.

Left 4

指示点击了设计器的左侧。Indicates that the left part of the designer was hit.

None 0

指示未点击设计器的任何部分。Indicates that no part of the designer was hit.

Right 16

指示点击了设计器的右侧。Indicates the right part of the designer was hit.

Top 8

指示点击了设计器的顶部。Indicates the top of the designer was hit.


下面的示例演示如何使用 CompositeActivityDesigner 类的基于设计器的中断来添加新的分支。The following example shows the addition of a new branch using a designer based off of the CompositeActivityDesigner class. 如果 CanInsertActivities 返回 true,则使用 InsertActivities 方法创建一个新分支。If CanInsertActivities returns true, a new branch is created using the InsertActivities method. 通过指定设计器标志, 使用工作流InsertActivities设计器的位置将对象创建为方法的参数。ConnectorHitTestInfoA ConnectorHitTestInfo object is created as a parameter to the InsertActivities method using the location of the workflow designer by specifying the Designer flag. 创建完成后,可使用 EnsureVisibleContainedDesigner 方法来确保新添加的分支显示在工作流设计器中。When this is finished, the EnsureVisibleContainedDesigner method is used to ensure that the newly added branch is displayed in the workflow designer.

protected override CompositeActivity OnCreateNewBranch()
    return new ParallelIfBranch();
Protected Overrides Function OnCreateNewBranch() As CompositeActivity
    Return New ParallelIfBranch()
End Function



本材料讨论的类型和命名空间已废弃不用。This material discusses types and namespaces that are obsolete. 有关详细信息,请参阅 Windows Workflow Foundation 4.5 中弃用的类型For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

HitTestLocations 方法使用 HitTest 来描述鼠标单击操作和拖放操作所点击的设计器区域。HitTestLocations is used by HitTest methods to describe the area of the designer hit by mouse clicks and drag and drop operations. 使用 HitTestLocations 可以决定在点击测试成功后执行何种操作。Use the HitTestLocations to decide what kind of action to take in response to a successful hit test.