FortuneTemplate.cs 733 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections.Generic;
  2. using System.IO;
  3. using System.Text;
  4. using System.Web;
  5. using Revenj.Http;
  6. namespace Revenj.Bench
  7. {
  8. public partial class Fortunes : IHtmlView
  9. {
  10. private readonly static StringBuilder Fake = new StringBuilder(0);
  11. public Fortunes(List<KeyValuePair<int, string>> arg)
  12. {
  13. this._fortunesField = arg;
  14. this.GenerationEnvironment = Fake;
  15. }
  16. private new void Write(string what) { writer.Write(what); }
  17. public void Show(int what) { writer.Write(what); }
  18. public void Show(string what) { HttpUtility.HtmlEncode(what, writer); }
  19. private TextWriter writer;
  20. public void Render(TextWriter writer)
  21. {
  22. this.writer = writer;
  23. TransformText();
  24. }
  25. }
  26. }