CompositeActivity.CanModifyActivities 属性

定义

获取或设置一个值,该值控制是否可以修改 Activities 中的单个活动。

protected public:
 property bool CanModifyActivities { bool get(); void set(bool value); };
protected internal bool CanModifyActivities { get; set; }
member this.CanModifyActivities : bool with get, set
Protected Friend Property CanModifyActivities As Boolean

属性值

如果可以修改 true 中的单个活动,则为 Activities;否则为 false

示例

下面的代码演示如何创建活动并将其作为子级添加到复合活动中,还演示如何设置此类型的 CanModifyActivities 许可。

此代码示例摘自 ThrowWorkFlow.cs 文件中的“引发 SDK”示例。 有关详细信息,请参阅 引发示例

this.CanModifyActivities = true;
System.Workflow.ComponentModel.ActivityBind activitybind1 = new System.Workflow.ComponentModel.ActivityBind();
this.throwActivity1 = new System.Workflow.ComponentModel.ThrowActivity();
activitybind1.Name = "ThrowWorkflow";
activitybind1.Path = "ThrownException";
//
// throwActivity1
//
this.throwActivity1.Name = "throwActivity1";
this.throwActivity1.SetBinding(System.Workflow.ComponentModel.ThrowActivity.FaultProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
//
// ThrowWorkflow
//
this.Activities.Add(this.throwActivity1);
this.Name = "ThrowWorkflow";
this.CanModifyActivities = false;
Me.CanModifyActivities = True
Dim activitybind1 As New System.Workflow.ComponentModel.ActivityBind()
Me.throwActivity1 = New System.Workflow.ComponentModel.ThrowActivity()
activitybind1.Name = "ThrowWorkflow"
activitybind1.Path = "ThrownException"
' 
' throwActivity1
' 
Me.throwActivity1.Name = "throwActivity1"
Me.throwActivity1.SetBinding(System.Workflow.ComponentModel.ThrowActivity.FaultProperty, activitybind1)
' 
' ThrowWorkflow
' 
Me.Activities.Add(Me.throwActivity1)
Me.Name = "ThrowWorkflow"
Me.CanModifyActivities = False

适用于