private void WriteChained(ChainedCodeFragment fragment, IOutputCache output) { this.progressedChainedCodeFragments.Add(fragment.First()); bool isFirst = true; foreach (ChainedCodeFragment codeFragment in fragment.First().Yield().Cast <ChainedCodeFragment>()) { if (!isFirst) { output.Add(codeFragment.Separator); } isFirst = false; this.Write(codeFragment, output); //output.Add(codeFragment, this); if (codeFragment.NewLineAfter) { output.BreakLine(); } if (codeFragment.CloseAfter) { output.CloseLine(); } if (codeFragment.BreakAfter) { output.BreakLine().ExtraIndent(); } } }
public static OperatorTemplate NotEquals(this ChainedCodeFragment template) { return(new OperatorTemplate(Operator.NotEquals).Chain(template)); }
public static NullValueTemplate Undefined(this ChainedCodeFragment template) { return(new NullValueTemplate().Chain(template)); }
public static ExecuteGenericMethodTemplate GenericMethod(this ChainedCodeFragment template, string methodName, TypeTemplate type0, TypeTemplate type1, TypeTemplate type2, TypeTemplate type3, TypeTemplate type4, params ICodeFragment[] parameters) { return(new ExecuteGenericMethodTemplate(methodName, new[] { type0, type1, type2, type3, type4 }, parameters).Chain(template)); }
public static ExecuteGenericMethodTemplate GenericMethod(this ChainedCodeFragment template, string methodName, params ICodeFragment[] parameters) { return(new ExecuteGenericMethodTemplate(methodName, null, parameters).Chain(template)); }
public static ExecutePropertyTemplate Property(this ChainedCodeFragment template, PropertyTemplate property) { return(new ExecutePropertyTemplate(property.Name).Chain(template)); }
public static ExecuteMethodTemplate Method(this ChainedCodeFragment template, MethodTemplate method, IEnumerable <ICodeFragment> parameters) { return(Method(template, method.Name, parameters)); }
public static ExecuteMethodTemplate Method(this ChainedCodeFragment template, MethodTemplate method, params ICodeFragment[] parameters) { return(Method(template, method.Name, parameters)); }
public static ThisTemplate This(this ChainedCodeFragment template) { return(new ThisTemplate().Chain(template)); }
public static LocalVariableTemplate Local(this ChainedCodeFragment template, ParameterTemplate type) { return(new LocalVariableTemplate(type.Name).Chain(template)); }
public static NumberTemplate Number(this ChainedCodeFragment template, int value) { return(new NumberTemplate(value).Chain(template)); }
public static LocalVariableTemplate Local(this ChainedCodeFragment template, string name) { return(new LocalVariableTemplate(name).Chain(template)); }
public static AppendAssignStringTemplate AppendAssign(this ChainedCodeFragment template, ICodeFragment code) { return(new AppendAssignStringTemplate(code).Chain(template)); }
public static OperatorTemplate GreaterThan(this ChainedCodeFragment template) { return(new OperatorTemplate(Operator.GreaterThan).Chain(template)); }
public static OperatorTemplate Lower(this ChainedCodeFragment template) { return(new OperatorTemplate(Operator.Lower).Chain(template)); }
public static NullCoalescingTemplate NullCoalescing(this ChainedCodeFragment template) { return(new NullCoalescingTemplate().Chain(template)); }
public static ICodeFragment NullCoalescing(this ChainedCodeFragment template, ICodeFragment code) { return(new NullCoalescingTemplate(code).Chain(template)); }
public static AsTemplate As(this ChainedCodeFragment template, TypeTemplate type) { return(new AsTemplate(type).Chain(template)); }
public static ExecuteMethodTemplate Method(this ChainedCodeFragment template, string methodName, IEnumerable <ICodeFragment> parameters) { return(new ExecuteMethodTemplate(methodName, parameters).Chain(template)); }
public static CastTemplate Cast(this ChainedCodeFragment template, TypeTemplate type) { return(new CastTemplate(type).Chain(template)); }
public static ExecuteFieldTemplate Field(this ChainedCodeFragment template, FieldTemplate field) { return(new ExecuteFieldTemplate(field.Name).Chain(template)); }
public static NotTemplate Not(this ChainedCodeFragment template) { return(new NotTemplate().Chain(template)); }
public static ExecuteGenericMethodTemplate GenericMethod(this ChainedCodeFragment template, string methodName, params TypeTemplate[] types) { return(new ExecuteGenericMethodTemplate(methodName, types).Chain(template)); }
public static MathematicalOperatorTemplate Subtract(this ChainedCodeFragment template) { return(new MathematicalOperatorTemplate("-").Chain(template)); }
public static StringTemplate String(this ChainedCodeFragment template, string value) { return(new StringTemplate(value).Chain(template)); }
public static MathematicalOperatorTemplate Multiply(this ChainedCodeFragment template) { return(new MathematicalOperatorTemplate("*").Chain(template)); }
public static AccessIndexTemplate Index(this ChainedCodeFragment template, ICodeFragment code) { return(new AccessIndexTemplate(code).Chain(template)); }
public static MathematicalOperatorTemplate Divide(this ChainedCodeFragment template) { return(new MathematicalOperatorTemplate("/").Chain(template)); }
public static ForceNullValueTemplate ForceNull(this ChainedCodeFragment template) { return(new ForceNullValueTemplate().Chain(template)); }
public static NullConditionalTemplate NullConditional(this ChainedCodeFragment template) { return(new NullConditionalTemplate().Chain(template)); }