RuleConditionDialog Class
.NET Framework 3.0
This dialog is normally used by the activities IfElseBranchActivity, WhileActivity, ConditionedActivityGroup and ReplicatorActivity to edit declarative conditions. However, if you want to use conditions outside of these activities (for example, edit a condition for use outside of a workflow completely), you can use this dialog to perform the editing of the condition.
Namespace: System.Workflow.Activities.Rules.Design
Assembly: System.Workflow.Activities (in system.workflow.activities.dll)
Assembly: System.Workflow.Activities (in system.workflow.activities.dll)
To use the dialog box, create an instance and show the dialog. If OK is selected, the property Expression contains the CodeExpression entered by the user.
For example, to create a CodeExpression where the "this" activity is a class of your choosing, and execute the condition if OK is pressed, you could use:
// No expression to start with
CodeExpression expression = null;
using (RuleConditionDialog dialog = new RuleConditionDialog(typeof(TestClass), null, expression))
{
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
expression = dialog.Expression;
RuleExpressionCondition condition = new RuleExpressionCondition(expression);
RuleValidation validation = new RuleValidation(typeof(TestClass), null);
if (condition.Validate(validation))
{
RuleValidation execution = new RuleExecution(validation, new TestClass());
Console.WriteLine("Expression evaluates to " + condition.Evaluate(execution));
}
}
}
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.RuleConditionDialog
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.RuleConditionDialog
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.Community Additions
ADD
Show: