This dialog is normally used by PolicyActivity to edit rule sets. However, if you want to use a rule set outside of this activity (for example, edit a rule set for use outside of a workflow), you can use this dialog to perform the editing of the rule set.
Namespace:
System.Workflow.Activities.Rules.Design
Assembly:
System.Workflow.Activities (in System.Workflow.Activities.dll)
Visual Basic (Declaration)
Public Class RuleSetDialog _
Inherits Form
Dim instance As RuleSetDialog
public class RuleSetDialog : Form
public ref class RuleSetDialog : public Form
public class RuleSetDialog extends Form
To use the dialog box, create an instance and show the dialog. If OK is selected, the property RuleSet contains the RuleSet modified by the user.
To create a RuleSet where the "this" activity is a class of your choosing, and execute the RuleSet if OK is pressed, you could use:
RuleSet ruleSet = null; // no rule set to start with
using (RuleSetDialog dialog = new RuleSetDialog(typeof(TestClass), null, ruleSet))
{
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
ruleSet = dialog.RuleSet;
RuleValidation validation = new RuleValidation(typeof(TestClass), null);
RuleEngine engine = new RuleEngine(ruleSet, validation);
TestClass testObject = new TestClass();
engine.Execute(testObject);
}
}
System..::.Object
System..::.MarshalByRefObject
System.ComponentModel..::.Component
System.Windows.Forms..::.Control
System.Windows.Forms..::.ScrollableControl
System.Windows.Forms..::.ContainerControl
System.Windows.Forms..::.Form
System.Workflow.Activities.Rules.Design..::.RuleSetDialog
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0
Reference