Logo Search packages:      
Sourcecode: ndoc version File versions  Download package

bool NDoc::Documenter::LinearHtml::LinearHtmlDocumenter::EmitHtml ( string  fileName  )  [inline, private]

This writes the html corresponding to the xml we've already internalized.

Parameters:
fileName The name of the file to write to.
Returns:

Definition at line 1705 of file LinearHtmlDocumenter.cs.

            {
                  StreamWriter sw = File.CreateText(fileName);
                  Stream fs = sw.BaseStream;

                  //
                  // doc head
                  //
                  XmlTextWriter topWriter = new XmlTextWriter(fs, Encoding.UTF8);
                  //topWriter.Formatting = Formatting.Indented;
                  topWriter.Indentation = 4;
                  //topWriter.WriteRaw("<html dir=\"LTR\">\n");
                  topWriter.WriteStartElement("html");
                  topWriter.WriteAttributeString("dir", "LTR");

                  topWriter.WriteStartElement("head");

                  topWriter.WriteElementString("title", "Example");
                  topWriter.WriteRaw("    <META http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
                  topWriter.WriteRaw("          <meta name=\"vs_targetSchema\" content=\"http://schemas.microsoft.com/intellisense/ie5\">\n     ");
                  //          <xml></xml><link rel="stylesheet" type="text/css" href="MSDN.css">
                  topWriter.WriteRaw("          <LINK rel=\"stylesheet\" href=\"LinearHtml.css\" type=\"text/css\">\n");
                  topWriter.WriteEndElement(); // head
                  //topWriter.WriteRaw("  <body>\n");
                  topWriter.WriteStartElement("body");
                  topWriter.WriteString(" "); // to close previous start, because of interleaved writers to same stream
                  topWriter.Flush();

                  //
                  // namespace list
                  //
                  MemoryStream ms = (MemoryStream)namespaceListWriter.BaseStream;
                  ms.Position = 0;
                  fs.Write(ms.GetBuffer(), 0, (int)ms.Length);
                  fs.Flush();

                  // namespace section header
//                topWriter.WriteElementString("h1", "Namespace Specifications");
//                topWriter.Flush();

                  //
                  // namespaces
                  //
                  XmlTextWriter xtw;

                  // build list of sections for namespaces
                  ArrayList nsSectionList = new ArrayList(orderedNamespaceSections);
                  nsSectionList.Insert(0, "typeList"); // use this for the type list too

                  foreach(string namespaceName in namespaceWriters.Keys)
                  {
                        topWriter.WriteElementString("h1", "Namespace : " + namespaceName);
                        topWriter.Flush();
                        Hashtable nsSectionWriters = (Hashtable)namespaceWriters[namespaceName];

                        foreach(string sectionKey in nsSectionList)
                        {
                              string sectionName = (string)namespaceSections[sectionKey];

                              xtw = null;
                              if (nsSectionWriters.ContainsKey(sectionName))
                              {
                                    // so something was written to this section
                                    xtw = (XmlTextWriter)nsSectionWriters[sectionName];
                                    xtw.Flush();

                                    // copy to output stream
                                    ms = (MemoryStream)xtw.BaseStream;
                                    ms.Position = 0;
                                    fs.Write(ms.GetBuffer(), 0, (int)ms.Length);
                              }
                              else
                              {
                                    // nothing in this section
                              }
                        }
                  }

                  // doc close
                  topWriter.WriteEndElement(); // body
                  topWriter.WriteEndElement(); // html
                  topWriter.Flush();

                  fs.Close();
                  return(true);
            }


Generated by  Doxygen 1.6.0   Back to index