Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
            }
        }