Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string GetHTML(SPListItem item, string TemplateText, string[] Fields)
- {
- foreach (string str in Fields)
- {
- string str2 = "$" + str + "(";
- int index = TemplateText.IndexOf(str2);
- if (index > -1)
- {
- int num2 = TemplateText.IndexOf(")", index);
- string str3 = TemplateText.Substring(index + str2.Length, (num2 - index) - str2.Length);
- TemplateText = TemplateText.Replace(str2 + str3 + ")$", string.Format("{0:" + str3 + "}", this.GetObject(item.get_Item(str))));
- }
- string str4 = "$" + str + "$";
- if (TemplateText.IndexOf(str4) > -1)
- {
- TemplateText = TemplateText.Replace(str4, this.GetObject(item.get_Item(str)).ToString());
- }
- }
- if (TemplateText.IndexOf("$A$") > -1)
- {
- TemplateText = TemplateText.Replace("$A$", this.GetNextLetter().ToString());
- }
- return TemplateText;
- }
Add Comment
Please, Sign In to add comment