RuleSet Class
Assembly: System.Workflow.Activities (in system.workflow.activities.dll)
The following example shows how to programmatically create a RuleSet. In this example, a RuleSet object is first created before rules are added to it. Following this, reference expressions are created in order to connect the rules with instance data present in the class that implements the BuildRuleSet method. The discount, orderValue and customerType references are fields defined within the class. The next step is to create the residential discount rule using objects from the System.CodeDom namespace. The rule that is being created, checks if the order value is greater than 500 and if the customer type is residential. If the condition is true, the discount that is applied is 5%. Next, a similar rule is created using different values to indicate a discount that is applied if the customer is a business customer type. Both of these rules are added to the initial RuleSet.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Reference
RuleSet MembersSystem.Workflow.Activities.Rules Namespace