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; }
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); }
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; }