StructuredCompositeActivityDesigner.CanInsertActivities 方法

定义

返回一个值,该值指示是否可以将指定的活动添加到工作流设计图面上指定位置的 StructuredCompositeActivityDesigner

public:
 override bool CanInsertActivities(System::Workflow::ComponentModel::Design::HitTestInfo ^ insertLocation, System::Collections::ObjectModel::ReadOnlyCollection<System::Workflow::ComponentModel::Activity ^> ^ activitiesToInsert);
public override bool CanInsertActivities (System.Workflow.ComponentModel.Design.HitTestInfo insertLocation, System.Collections.ObjectModel.ReadOnlyCollection<System.Workflow.ComponentModel.Activity> activitiesToInsert);
override this.CanInsertActivities : System.Workflow.ComponentModel.Design.HitTestInfo * System.Collections.ObjectModel.ReadOnlyCollection<System.Workflow.ComponentModel.Activity> -> bool
Public Overrides Function CanInsertActivities (insertLocation As HitTestInfo, activitiesToInsert As ReadOnlyCollection(Of Activity)) As Boolean

参数

insertLocation
HitTestInfo

包含试图插入活动的屏幕位置的 HitTestInfo

activitiesToInsert
ReadOnlyCollection<Activity>

包含要添加的活动的 Activity 只读集合。

返回

如果可以将指定活动插入工作流设计图面的指定位置,则为 true;否则为 false

示例

下面的示例演示如何通过不允许插入子活动来锁定 StructuredCompositeActivityDesigner

public override bool CanInsertActivities(HitTestInfo insertLocation, ReadOnlyCollection<Activity> activitiesToInsert)
{
    return false;
}
Public Overrides Function CanInsertActivities(ByVal insertLocation As HitTestInfo, ByVal activitiesToInsert As ReadOnlyCollection(Of Activity)) As Boolean
    Return False
End Function

适用于