共用方式為


RuleSetReference 建構函式

定義

初始化 RuleSetReference 類別的新執行個體。

多載

RuleSetReference()

初始化 RuleSetReference 類別的新執行個體。

RuleSetReference(String)

使用 RuleSetReference 的名稱,初始化 RuleSet 類別的新執行個體。

RuleSetReference()

初始化 RuleSetReference 類別的新執行個體。

public:
 RuleSetReference();
public RuleSetReference ();
Public Sub New ()

範例

下列程式碼範例示範如何建立 RuleSetReference 類別的新執行個體,並將其設定為 PolicyActivity.RuleSetReference 屬性的值。 這個程式碼範例是 SimplePolicyWorkflow.designer.cs 檔案中<RuleActionTrackingEventSample SDK>範例的一部分。 如需詳細資訊,請參閱 RuleActionTrackingEvent 範例

this.CanModifyActivities = true;
System.Workflow.Activities.Rules.RuleSetReference rulesetreference1 = new System.Workflow.Activities.Rules.RuleSetReference();
this.simpleDiscountPolicy = new System.Workflow.Activities.PolicyActivity();
//
// simpleDiscountPolicy
//
this.simpleDiscountPolicy.Name = "simpleDiscountPolicy";
rulesetreference1.RuleSetName = "DiscountRuleSet";
this.simpleDiscountPolicy.RuleSetReference = rulesetreference1;
//
// SimplePolicyWorkflow
//
this.Activities.Add(this.simpleDiscountPolicy);
this.Name = "SimplePolicyWorkflow";
this.Completed += new System.EventHandler(this.WorkflowCompleted);
this.CanModifyActivities = false;
Me.CanModifyActivities = True
Dim rulesetreference1 As System.Workflow.Activities.Rules.RuleSetReference = New System.Workflow.Activities.Rules.RuleSetReference
Me.simpleDiscountPolicy = New System.Workflow.Activities.PolicyActivity
' 
' simpleDiscountPolicy
' 
Me.simpleDiscountPolicy.Name = "simpleDiscountPolicy"
rulesetreference1.RuleSetName = "DiscountRuleSet"
Me.simpleDiscountPolicy.RuleSetReference = rulesetreference1
' 
' SimplePolicyWorkflow
' 
Me.Activities.Add(Me.simpleDiscountPolicy)
Me.Name = "SimplePolicyWorkflow"
AddHandler Completed, AddressOf Me.OnWorkflowCompleted
Me.CanModifyActivities = False

適用於

RuleSetReference(String)

使用 RuleSetReference 的名稱,初始化 RuleSet 類別的新執行個體。

public:
 RuleSetReference(System::String ^ ruleSetName);
public RuleSetReference (string ruleSetName);
new System.Workflow.Activities.Rules.RuleSetReference : string -> System.Workflow.Activities.Rules.RuleSetReference
Public Sub New (ruleSetName As String)

參數

ruleSetName
String

活動要評估之 RuleSet 的名稱。

範例

下列程式碼範例示範如何使用 RuleSet 名稱,建立 RuleSetReference 類別的新執行個體。 這個程式碼範例是 DiscountPolicyWorkflow.Designer.cs 檔案中<原則 SDK>範例的一部分。 如需詳細資訊,請參閱 進階原則

public sealed partial class DiscountPolicyWorkflow
{
    [System.Diagnostics.DebuggerNonUserCode()]
    private void InitializeComponent()
    {
        this.CanModifyActivities = true;
        System.Workflow.Activities.Rules.RuleSetReference rulesetreference1 = new System.Workflow.Activities.Rules.RuleSetReference();
        this.advancedDiscountPolicy = new System.Workflow.Activities.PolicyActivity();
        //
        // advancedDiscountPolicy
        //
        this.advancedDiscountPolicy.Name = "advancedDiscountPolicy";
        rulesetreference1.RuleSetName = "DiscountRuleSet";
        this.advancedDiscountPolicy.RuleSetReference = rulesetreference1;
        //
        // DiscountPolicyWorkflow
        //
        this.Activities.Add(this.advancedDiscountPolicy);
        this.Name = "DiscountPolicyWorkflow";
        this.Completed += new System.EventHandler(this.WorkflowCompleted);
        this.CanModifyActivities = false;
    }

    private PolicyActivity advancedDiscountPolicy;
}
Partial Public NotInheritable Class DiscountPolicyWorkflow

    <System.Diagnostics.DebuggerNonUserCode()> _
                Private Sub InitializeComponent()

        Me.CanModifyActivities = True
        Dim rulesetreference1 As New System.Workflow.Activities.Rules.RuleSetReference()
        Me.advancedDiscountPolicy = New System.Workflow.Activities.PolicyActivity()
        ' 
        ' advancedDiscountPolicy
        ' 
        Me.advancedDiscountPolicy.Name = "advancedDiscountPolicy"
        rulesetreference1.RuleSetName = "DiscountRuleSet"
        Me.advancedDiscountPolicy.RuleSetReference = rulesetreference1
        ' 
        ' DiscountPolicyWorkflow
        ' 
        Me.Activities.Add(Me.advancedDiscountPolicy)
        Me.Name = "DiscountPolicyWorkflow"
        AddHandler Me.Completed, AddressOf Me.WorkflowCompleted
        Me.CanModifyActivities = False

    End Sub

    Private advancedDiscountPolicy As PolicyActivity
End Class

適用於