Export (0) Print
Expand All

Rule Class

Defines a condition with an associated set of actions to perform.

System.Object
  System.Workflow.Activities.Rules.Rule

Namespace:  System.Workflow.Activities.Rules
Assembly:  System.Workflow.Activities (in System.Workflow.Activities.dll)

[SerializableAttribute]
public class Rule

The Rule type exposes the following members.

  NameDescription
Public methodRule()Initializes a new instance of the Rule class.
Public methodRule(String)Initializes a new instance of the Rule class using the name of the Rule.
Public methodRule(String, RuleCondition, IList<RuleAction>)Initializes a new instance of the Rule class using the name of the Rule, the rule condition, and a list of THEN actions.
Public methodRule(String, RuleCondition, IList<RuleAction>, IList<RuleAction>)Initializes a new instance of the Rule class using the name of the Rule, the rule condition, a list of THEN actions, and a list of ELSE actions.
Top

  NameDescription
Public propertyActiveGets or sets a value that indicates whether the Rule should be evaluated.
Public propertyConditionGets or sets a RuleCondition for the Rule to evaluate.
Public propertyDescriptionGets or sets a description of the Rule.
Public propertyElseActionsGets a collection of RuleAction classes to perform in the ELSE case.
Public propertyNameGets or sets the name of the Rule.
Public propertyPriorityGets or sets a value that indicates the order in which a Rule should be run.
Public propertyReevaluationBehaviorGets or sets a value indicating whether a Rule can be reevaluated.
Public propertyThenActionsGets a collection of RuleAction classes to perform in the THEN case.
Top

  NameDescription
Public methodCloneCreates a deep copy of the current Rule.
Public methodEqualsDetermines whether this instance of Rule and the object passed as the parameter have the same value. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this instance. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

A Rule consists of a RuleCondition and one or both ThenActions or ElseActions collections.

The following example shows how to create a named Rule.

private Rule firstRule = new Rule("firstRule");

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft