Пример #1
0
        private void InitHeader()
        {
            writer.WriteLineNoTabs("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
            writer.AddAttribute("xmlns", "http://www.w3.org/1999/xhtml");
            writer.AddAttribute("xml:lang", "en");
            writer.RenderBeginTag(HtmlTextWriterTag.Html);
            writer.RenderBeginTag(HtmlTextWriterTag.Head);

            writer.RenderBeginTag(HtmlTextWriterTag.Title);
            writer.Write("XhtmlDumper");
            writer.RenderEndTag();


            writer.AddAttribute("http-equiv", "content-type");
            writer.AddAttribute(HtmlTextWriterAttribute.Content, "text/html;charset=utf-8");
            writer.RenderBeginTag(HtmlTextWriterTag.Meta);
            writer.RenderEndTag();
            writer.WriteLine();

            writer.AddAttribute(HtmlTextWriterAttribute.Name, "generator");
            writer.AddAttribute(HtmlTextWriterAttribute.Content, "XhtmlDumper");
            writer.RenderBeginTag(HtmlTextWriterTag.Meta);
            writer.RenderEndTag();
            writer.WriteLine();

            writer.AddAttribute(HtmlTextWriterAttribute.Name, "description");
            writer.AddAttribute(HtmlTextWriterAttribute.Content, "Generated on: " + DateTime.Now);
            writer.RenderBeginTag(HtmlTextWriterTag.Meta);
            writer.RenderEndTag();
            writer.WriteLine();

            writer.AddAttribute("type", "text/css");
            writer.RenderBeginTag(HtmlTextWriterTag.Style);
            writer.WriteLineNoTabs(Resources.StyleSheet);
            writer.RenderEndTag(); // style

            writer.RenderEndTag(); // Head
            writer.WriteLine();

            writer.RenderBeginTag(HtmlTextWriterTag.Body);
        }