Exemple #1
0
 protected override object OnNewInternal()
 {
     using (RuleConditionDialog dlg = new RuleConditionDialog(this.Activity, null))
     {
         if (DialogResult.OK == dlg.ShowDialog(this))
         {
             RuleExpressionCondition declarativeRuleDefinition = new RuleExpressionCondition();
             declarativeRuleDefinition.Expression = dlg.Expression;
             declarativeRuleDefinition.Name       = this.CreateNewName();
             this.declarativeConditionCollection.Add(declarativeRuleDefinition);
             return(declarativeRuleDefinition);
         }
     }
     return(null);
 }
 protected override object OnNewInternal()
 {
     using (RuleConditionDialog dlg = new RuleConditionDialog(this.Activity, null))
     {
         if (DialogResult.OK == dlg.ShowDialog(this))
         {
             RuleExpressionCondition declarativeRuleDefinition = new RuleExpressionCondition();
             declarativeRuleDefinition.Expression = dlg.Expression;
             declarativeRuleDefinition.Name = this.CreateNewName();
             this.declarativeConditionCollection.Add(declarativeRuleDefinition);
             return declarativeRuleDefinition;
         }
     }
     return null;
 }
Exemple #3
0
 protected override object OnNewInternal()
 {
     using (RuleConditionDialog dialog = new RuleConditionDialog(base.Activity, null))
     {
         if (DialogResult.OK == dialog.ShowDialog(this))
         {
             RuleExpressionCondition item = new RuleExpressionCondition {
                 Expression = dialog.Expression,
                 Name       = this.CreateNewName()
             };
             this.declarativeConditionCollection.Add(item);
             return(item);
         }
     }
     return(null);
 }
Exemple #4
0
        protected override bool OnEditInternal(object currentRuleObject, out object updatedRuleObject)
        {
            RuleExpressionCondition condition = currentRuleObject as RuleExpressionCondition;

            updatedRuleObject = null;
            using (RuleConditionDialog dialog = new RuleConditionDialog(base.Activity, condition.Expression))
            {
                if (DialogResult.OK == dialog.ShowDialog(this))
                {
                    updatedRuleObject = new RuleExpressionCondition(condition.Name, dialog.Expression);
                    this.declarativeConditionCollection.Remove(condition.Name);
                    this.declarativeConditionCollection.Add(updatedRuleObject as RuleExpressionCondition);
                    return(true);
                }
            }
            return(false);
        }
        protected override bool OnEditInternal(object currentRuleObject, out object updatedRuleObject)
        {
            RuleExpressionCondition declarativeRuleDefinition = currentRuleObject as RuleExpressionCondition;
            updatedRuleObject = null;

            using (RuleConditionDialog dlg = new RuleConditionDialog(this.Activity, declarativeRuleDefinition.Expression))
            {
                if (DialogResult.OK == dlg.ShowDialog(this))
                {
                    updatedRuleObject = new RuleExpressionCondition(declarativeRuleDefinition.Name, dlg.Expression);

                    this.declarativeConditionCollection.Remove(declarativeRuleDefinition.Name);
                    this.declarativeConditionCollection.Add(updatedRuleObject as RuleExpressionCondition);

                    return true;
                }
            }
            return false;
        }