RuleSetReference Construtores
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Inicializa uma nova instância da classe RuleSetReference.
Sobrecargas
RuleSetReference() |
Inicializa uma nova instância da classe RuleSetReference. |
RuleSetReference(String) |
Inicializa uma nova instância da classe RuleSetReference usando o nome do RuleSet. |
RuleSetReference()
Inicializa uma nova instância da classe RuleSetReference.
public:
RuleSetReference();
public RuleSetReference ();
Public Sub New ()
Exemplos
O exemplo de código a seguir mostra como criar uma nova instância da RuleSetReference classe e defini-la como o valor da PolicyActivity.RuleSetReference propriedade. Este exemplo de código faz parte do exemplo de SDK RuleActionTrackingEventSample do arquivo SimplePolicyWorkflow.designer.cs. Para obter mais informações, consulte Exemplo de 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
Aplica-se a
RuleSetReference(String)
Inicializa uma nova instância da classe RuleSetReference usando o nome do 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)
Parâmetros
Exemplos
O exemplo de código a seguir mostra como criar uma nova instância da RuleSetReference classe usando o nome de um RuleSet. Este exemplo de código faz parte do exemplo de SDK de Política do arquivo DiscountPolicyWorkflow.Designer.cs. Para obter mais informações, consulte Política Avançada.
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