Prototype_distributor.cs 865 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.IO;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using OpenSim.Framework;
  7. namespace OpenSim.Region.UserStatistics
  8. {
  9. public class Prototype_distributor : IStatsController
  10. {
  11. private string prototypejs=string.Empty;
  12. public Hashtable ProcessModel(Hashtable pParams)
  13. {
  14. Hashtable pResult = new Hashtable();
  15. if (prototypejs.Length == 0)
  16. {
  17. StreamReader fs = new StreamReader(new FileStream(Util.dataDir() + "/data/prototype.js", FileMode.Open));
  18. prototypejs = fs.ReadToEnd();
  19. }
  20. pResult["js"] = prototypejs;
  21. return pResult;
  22. }
  23. public string RenderView(Hashtable pModelResult)
  24. {
  25. return pModelResult["js"].ToString();
  26. }
  27. }
  28. }