public override void ToString(StringBuilder sb, ScopedDictionary <string, ValueProviderBase> variables) { sb.Append("@foreach"); ValueProvider !.ToStringBrackets(sb, variables, null); { var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); ValueProvider.Declare(newVars); Block.ToString(sb, newVars); } sb.Append("@endforeach"); }
public override void ToString(StringBuilder sb, ScopedDictionary <string, ValueProviderBase> variables) { sb.Append("@any"); Condition.ToStringBrackets(sb, variables); { var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); Condition.Declare(newVars); AnyBlock.ToString(sb, newVars); } if (NotAnyBlock != null) { sb.Append("@notany"); var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); Condition.Declare(newVars); NotAnyBlock.ToString(sb, newVars); } sb.Append("@endany"); }
public override void ToString(StringBuilder sb, ScopedDictionary <string, ValueProviderBase> variables) { sb.Append("@if"); ValueProvider.ToString(sb, variables, Operation == null ? null : FilterValueConverter.ToStringOperation(Operation.Value) + Value); { var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); ValueProvider.Declare(newVars); IfBlock.ToString(sb, newVars); } if (ElseBlock != null) { sb.Append("@else"); var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); ValueProvider.Declare(newVars); ElseBlock.ToString(sb, newVars); } sb.Append("@endif"); }
public override void ToString(StringBuilder sb, ScopedDictionary <string, ValueProviderBase> variables) { sb.Append("@if["); Condition.ToStringInternal(sb, variables); sb.Append("]"); { var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); Condition.Declare(newVars); IfBlock.ToString(sb, newVars); } if (ElseBlock != null) { sb.Append("@else"); var newVars = new ScopedDictionary <string, ValueProviderBase>(variables); Condition.Declare(newVars); ElseBlock.ToString(sb, newVars); } sb.Append("@endif"); }