Exemplo n.º 1
0
 public static void WriteKey(Mashup mashup, RenderOutputMethod renderOutput, string fileName)
 {
     TextWriter textWriter = new StreamWriter(renderOutput.CreateFile(fileName, "text/html"));
     string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(mashup.GetFilename());
     textWriter.WriteLine("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
     textWriter.WriteLine(string.Format("<html><head><title>{0}</title></head>", fileNameWithoutExtension));
     textWriter.WriteLine(string.Format("<body><h1>{0}</h1>", fileNameWithoutExtension));
     foreach (Layer current in mashup.layerList)
     {
         textWriter.WriteLine(string.Format("<p><h2><a name=\"{0}\">{1}</a></h2>", SampleHTMLWriter.ReferenceName(current.displayName), current.displayName));
         foreach (SourceMap current2 in current)
         {
             textWriter.WriteLine(string.Format("<p><h3>{0}</h3>", current2.displayName));
             if (current2.sourceMapInfo.mapHomePage != "")
             {
                 textWriter.WriteLine(string.Format("<a href=\"{0}\">Home page</a>", current2.sourceMapInfo.mapHomePage));
             }
             if (current2.sourceMapInfo.mapFileURL != "")
             {
                 textWriter.WriteLine(string.Format(" <a href=\"{0}\">Map URL</a>", current2.sourceMapInfo.mapFileURL));
             }
             textWriter.WriteLine(string.Format("<br>{0}", current2.sourceMapInfo.mapDescription));
         }
         textWriter.WriteLine("<hr>");
     }
     textWriter.WriteLine("</body></html>");
     textWriter.Close();
 }
Exemplo n.º 2
0
        public static void WriteKey(Mashup mashup, RenderOutputMethod renderOutput, string fileName)
        {
            TextWriter textWriter = new StreamWriter(renderOutput.CreateFile(fileName, "text/html"));
            string     fileNameWithoutExtension = Path.GetFileNameWithoutExtension(mashup.GetFilename());

            textWriter.WriteLine("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
            textWriter.WriteLine(string.Format("<html><head><title>{0}</title></head>", fileNameWithoutExtension));
            textWriter.WriteLine(string.Format("<body><h1>{0}</h1>", fileNameWithoutExtension));
            foreach (Layer current in mashup.layerList)
            {
                textWriter.WriteLine(string.Format("<p><h2><a name=\"{0}\">{1}</a></h2>", SampleHTMLWriter.ReferenceName(current.displayName), current.displayName));
                foreach (SourceMap current2 in current)
                {
                    textWriter.WriteLine(string.Format("<p><h3>{0}</h3>", current2.displayName));
                    if (current2.sourceMapInfo.mapHomePage != "")
                    {
                        textWriter.WriteLine(string.Format("<a href=\"{0}\">Home page</a>", current2.sourceMapInfo.mapHomePage));
                    }
                    if (current2.sourceMapInfo.mapFileURL != "")
                    {
                        textWriter.WriteLine(string.Format(" <a href=\"{0}\">Map URL</a>", current2.sourceMapInfo.mapFileURL));
                    }
                    textWriter.WriteLine(string.Format("<br>{0}", current2.sourceMapInfo.mapDescription));
                }
                textWriter.WriteLine("<hr>");
            }
            textWriter.WriteLine("</body></html>");
            textWriter.Close();
        }