public virtual void Write(ICodeFragment fragment, IOutputCache output) { TypeScriptTemplate template = (TypeScriptTemplate)fragment; output.Add(template.Code); if (template.CloseAfter) { output.CloseLine(); } if (template.BreakAfter) { output.BreakLine(); } if (template.StartBlockAfter) { output.StartBlock(); } if (template.EndBlockAfter) { output.EndBlock(); } if (template.IndentAfter) { output.Indent(); } if (template.UnindentAfter) { output.UnIndent(); } }
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(); } } }