public Input CloneInput(Input i, Rule r) { Input iClone = new Input(); iClone.Text = i.Text; iClone.Condition = i.Condition; iClone.Id = r.GetNewInputId(); return iClone; }
public Rule createRuleFromTemplateRow(Rule baseRule, System.Data.DataColumnCollection columns, System.Data.DataRow row, int index) { Rule newRule = new Rule(); newRule.Id = baseRule.Id + "_" + index; newRule.Name = this.replaceTemplateData(baseRule.Name, columns, row); foreach(Input i in baseRule.Inputs) { Input newInput = new Input(); newInput.Id = i.Id + "_" + index; newInput.Text = this.replaceTemplateData(i.Text, columns, row); newInput.Condition = this.replaceTemplateData(i.Condition, columns, row); newRule.Inputs.Add(newInput); } foreach(Output o in baseRule.Outputs) { Output newOutput = new Output(); newOutput.Id = o.Id + "_" + index; newOutput.Text = this.replaceTemplateData(o.Text, columns, row); newOutput.Cmd = this.replaceTemplateData(o.Cmd, columns, row); newOutput.Condition = this.replaceTemplateData(o.Condition, columns, row); newRule.Outputs.Add(newOutput); } foreach(Rule child in baseRule.Children) { newRule.Children.Add(this.createRuleFromTemplateRow(child, columns, row, index)); } newRule.VirtualParents = baseRule.VirtualParents; return newRule; }
/* * Modifier Methods */ public void AddInput(string stText, string stCond) { Input inputNew = new Input(); inputNew.Text = stText; inputNew.Condition = stCond; inputNew.Id = this.GetNewInputId(); this.Inputs.Add(inputNew); }