CompositeActivityDesigner.CanInsertActivities 方法

定义

返回一个值,该值指示是否可以将活动插入与设计器关联的复合活动中。

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

参数

insertLocation
HitTestInfo

要插入活动的位置。

activitiesToInsert
ReadOnlyCollection<Activity>

要插入的 Activity 的只读数组。

返回

Boolean

如果可以将活动插入与设计器关联的复合活动中,则为 true;否则为 false

示例

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

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

注解

使用 CanInsertActivities 可确定是否可以将一系列活动插入到复合活动中。

适用于