public string GetHtml() { HtmlDivision div = new HtmlDivision(); HtmlImage img = new HtmlImage(); img.Attributes.Add("id", Name); HtmlScript script = new HtmlScript(); System.IO.StringWriter js = new System.IO.StringWriter(); js.Write(string.Format("var images = new Array({0});", Images.Count)); js.Write(string.Format("var hrefs = new Array({0});", Images.Count)); int i = 0; foreach (var image in Images) { js.Write(string.Format("images[{0}] = \"{1}\";", i, image.Key)); js.Write(string.Format("hrefs[{0}] = \"{1}\";", i, image.Value)); i++; } //js.Write("$(document).ready(function() { $('{0}').setInterval(function() {}, {}) });"); script.InnerText = js.ToString(); // todo: finish this return(div.ToHtml()); }
public void Visit(HtmlScript h) { sb.AppendLine(); sb.Append(Tabs(h.Depth)); sb.AppendLine(string.Format("<{0}>", h.Tag)); foreach (var c in h.Contents) { Visit(c); } sb.Append(Tabs(h.Depth)); sb.AppendLine(string.Format("</{0}>", h.Tag)); }
private void AddScripts() { if (firstInvalidId != null) { HtmlScript script = new HtmlScript(); script.Add(new HtmlText(GetFocusFirstInvalidScript(firstInvalidId))); scripts.Add(script); } foreach (var s in scriptRegistry.SelectedScripts) { HtmlScript script = new HtmlScript(); script.Add(new HtmlText(s)); scripts.Add(script); } }