Guest User

Untitled

a guest
Jun 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. public string GetHTML(SPListItem item, string TemplateText, string[] Fields)
  2. {
  3. foreach (string str in Fields)
  4. {
  5. string str2 = "$" + str + "(";
  6. int index = TemplateText.IndexOf(str2);
  7. if (index > -1)
  8. {
  9. int num2 = TemplateText.IndexOf(")", index);
  10. string str3 = TemplateText.Substring(index + str2.Length, (num2 - index) - str2.Length);
  11. TemplateText = TemplateText.Replace(str2 + str3 + ")$", string.Format("{0:" + str3 + "}", this.GetObject(item.get_Item(str))));
  12. }
  13. string str4 = "$" + str + "$";
  14. if (TemplateText.IndexOf(str4) > -1)
  15. {
  16. TemplateText = TemplateText.Replace(str4, this.GetObject(item.get_Item(str)).ToString());
  17. }
  18. }
  19. if (TemplateText.IndexOf("$A$") > -1)
  20. {
  21. TemplateText = TemplateText.Replace("$A$", this.GetNextLetter().ToString());
  22. }
  23. return TemplateText;
  24. }
Add Comment
Please, Sign In to add comment