public UntilRangeTemplateElement(AbstractTemplateElement parent) : base(parent) { Minimum = new VariableConditionPart { VariableName = "Min2" }; Maximum = new OperationConditionPart { LeftSide = new VariableConditionPart { VariableName = "Max2" }, RightSide = new LiteralConditionPart { Value = "1" }, Operator = ConditionPartOperatorEnum.Add }; InludeMaximum = false; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = Environment.NewLine }, new DefineITemplateElement(this), new StaticTemplateElement(this) { Content = " " + Environment.NewLine + "-) Counting From {Min2} UNTIL {Max2} : {I} {FAV} " + Environment.NewLine } }; }
public DefineITemplateElement(AbstractTemplateElement parent) : base(parent) { IsArray = false; Variable = new VariableConditionPart { VariableName = "FAV" }; Elements = new AbstractTemplateElement[] { new I42ConditionalTemplateElement(this), }; }
public ChoicesEnumeratorTemplateElement(AbstractTemplateElement parent) : base(parent) { EnumerationCondition = new VariableConditionPart { VariableName = "Choice" }; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = Environment.NewLine + "- {Choice}" + Environment.NewLine } }; }
public ChoiceDefineTemplateElement(AbstractTemplateElement parent) : base(parent) { IsArray = true; Variable = new VariableConditionPart { VariableName = "Choice" }; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = Environment.NewLine + "Choice1" + Environment.NewLine + "Choice2" + Environment.NewLine + "Choice3" + Environment.NewLine + "BadChoice" + Environment.NewLine } }; }
public AnimalDefineTemplateElement(AbstractTemplateElement parent) : base(parent) { IsArray = false; Variable = new VariableConditionPart { VariableName = "Animal" }; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = "Rabbit" } }; }
public ChocolatesEnumeratorTemplateElement(AbstractTemplateElement parent) : base(parent) { EnumerationCondition = new VariableConditionPart { VariableName = "Chocolate" }; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = Environment.NewLine }, new FruitsEnumeratorTemplateElement(this), new StaticTemplateElement(this) { Content = Environment.NewLine }, }; }
private void SerializeVarPart(TextWriter tw, VariableConditionPart varPart) { string enumerationVariable = varPart.VariableName; var arrs = new Dictionary <string, IEnumerable <string> >(Arrays); arrs.Remove(enumerationVariable); var vars = new Dictionary <string, string>(Variables) { { enumerationVariable, null } }; foreach (var value in Arrays[enumerationVariable]) { vars[enumerationVariable] = value; foreach (var elem in Element.Elements) { TemplateSerializationFactory.Serialize(tw, elem, vars, arrs, Parms); } } }
public FruitsEnumeratorTemplateElement(AbstractTemplateElement parent) : base(parent) { EnumerationCondition = new VariableConditionPart { VariableName = "Fruit" }; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = " " + Environment.NewLine }, new BobAndBillyConditionalTemplateElement(this), new StaticTemplateElement(this) { Content = Environment.NewLine }, new ChocolateConditionalTemplateElement(this), new StaticTemplateElement(this) { Content = Environment.NewLine }, }; }
public PeopleEnumeratorTemplateElement(AbstractTemplateElement parent) : base(parent) { EnumerationCondition = new VariableConditionPart { VariableName = "Person" }; Elements = new AbstractTemplateElement[] { new StaticTemplateElement(this) { Content = Environment.NewLine + "Hello I am {Person} ({BigNumber}) " }, new BigNumberConditionalTemplateElement(this), new StaticTemplateElement(this) { Content = Environment.NewLine + Environment.NewLine + "*******" + Environment.NewLine }, new ChocolatesEnumeratorTemplateElement(this), new StaticTemplateElement(this) { Content = Environment.NewLine }, }; }