Exemplo n.º 1
0
        public void AddJavascriptFile(string pathToJavascript)
        {
            XmlElement element = Head.AppendChild(_dom.CreateElement("script")) as XmlElement;

            element.SetAttribute("type", "text/javascript");
            element.SetAttribute("src", "file://" + pathToJavascript);
            Head.AppendChild(element);
        }
Exemplo n.º 2
0
        private XmlElement MakeJavascriptElement(string pathToJavascript)
        {
            XmlElement element = Head.AppendChild(_dom.CreateElement("script")) as XmlElement;

            element.IsEmpty = false;
            element.SetAttribute("type", "text/javascript");
            element.SetAttribute("src", pathToJavascript.ToLocalhost());
            return(element);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            // Append metas
            foreach (var meta in metas)
            {
                Head.AppendChild(meta);
            }

            // Append links
            foreach (var link in Links)
            {
                Head.AppendChild(link.ToNode(document));
            }

            // Append title
            Head.AppendChild(title);

            foreach (var script in Scripts)
            {
                Body.AppendChild(script.ToNode(document));
            }

            return($"<!doctype html>{document.OuterXml}");
        }
Exemplo n.º 4
0
 public void AddJavascriptFile(string pathToJavascript)
 {
     Head.AppendChild(MakeJavascriptElement(pathToJavascript));
 }