Пример #1
0
        public static bool WriteDocument(string fileName, string title, string cssStyleFile, WriteContents writeDelegate)
        {
            using (HTMLWriter writer = new HTMLWriter(fileName)) {
                writer.StartTag("head");
                {
                    writer.StartTag("title");
                    {
                        writer.WriteValue(title);
                    }
                    writer.EndTag();

                    if (cssStyleFile.Length > 0)
                    {
                        writer.ShortTag("link", "rel=\"stylesheet\" type=\"text/css\" href=\"" + cssStyleFile + "\"");
                    }
                }
                writer.EndTag();

                writer.StartTag("body");
                {
                    writeDelegate(writer);
                }
                writer.EndTag();
            }
            return(true);
        }
Пример #2
0
        public static bool WriteDocument(string fileName, string title, WriteContents writeDelegate)
        {
            HTMLWriter writer = new HTMLWriter(fileName);

            writer.StartTag("head");
            writer.StartTag("title");
            writer.WriteValue(title);
            writer.EndTag();
            writer.EndTag();
            writer.StartTag("body");
            writeDelegate(writer);
            writer.EndTag();
            return(true);
        }