Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
RuleSetDialog Class

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
RuleSetDialog Class

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
Visual Basic (Usage)
Dim instance As RuleSetDialog
C#
public class RuleSetDialog : Form
Visual C++
public ref class RuleSetDialog : public Form
JScript
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:

C#
    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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker