コード例 #1
0
        protected override string HitsToHtml(ArrayList hits)
        {
            DateTime StartExec = DateTime.Now;

            StringWriter sw = new StringWriter();
            XmlWriter    xw = new XmlTextWriter(sw);

            // Start the xhtml block
            xw.WriteStartElement("div");

            // Title of block
            xw.WriteStartElement("table");
            xw.WriteAttributeString("border", "0");
            xw.WriteAttributeString("width", "100%");
            xw.WriteStartElement("tr");
            xw.WriteStartElement("td");
            xw.WriteAttributeString("bgcolor", "#fffa6e");
            xw.WriteStartElement("font");
            xw.WriteAttributeString("size", "+2");
            xw.WriteString("Email Messages");
            xw.WriteEndElement();               // font
            xw.WriteEndElement();               // td
            xw.WriteEndElement();               // tr
            xw.WriteEndElement();               // table

            // The table of data
            xw.WriteStartElement("table");
            xw.WriteAttributeString("border", "0");
            xw.WriteAttributeString("cellpadding", "0");
            xw.WriteAttributeString("cellspacing", "0");
            xw.WriteAttributeString("width", "100%");

            // Sort results by date (newest first)
            IComparer mailmessagedatecomparer = new MailMessageDateComparer();

            hits.Sort(mailmessagedatecomparer);

            bool color_band = true;

            foreach (Hit hit in hits)
            {
                HTMLRenderSingleMailMessage(hit, color_band, xw);
                color_band = !color_band;
            }

            xw.WriteEndElement();              // table
            xw.WriteEndElement();              // div

            // close the xhtml doc
            xw.Close();

            // Console.WriteLine ("..Renderer: MailMessage.. elapsed time {0}", DateTime.Now - StartExec);

            return(sw.ToString());
        }
コード例 #2
0
		protected override string HitsToHtml (ArrayList hits)
		{
			DateTime StartExec = DateTime.Now;

			StringWriter sw = new StringWriter ();
			XmlWriter xw = new XmlTextWriter (sw);

			// Start the xhtml block
			xw.WriteStartElement ("div");

			// Title of block
			xw.WriteStartElement ("table");
			xw.WriteAttributeString ("border", "0");
			xw.WriteAttributeString ("width", "100%");
			xw.WriteStartElement ("tr");
			xw.WriteStartElement ("td");
			xw.WriteAttributeString ("bgcolor", "#fffa6e");
			xw.WriteStartElement ("font");
			xw.WriteAttributeString ("size", "+2");
			xw.WriteString ("Email Messages");
			xw.WriteEndElement ();	// font
			xw.WriteEndElement ();	// td
			xw.WriteEndElement ();	// tr
			xw.WriteEndElement ();	// table

			// The table of data
			xw.WriteStartElement ("table");
			xw.WriteAttributeString ("border", "0");
			xw.WriteAttributeString ("cellpadding", "0");
			xw.WriteAttributeString ("cellspacing", "0");
			xw.WriteAttributeString ("width", "100%");

			// Sort results by date (newest first)
			IComparer mailmessagedatecomparer = new MailMessageDateComparer ();
			hits.Sort (mailmessagedatecomparer);

			bool color_band = true;
			foreach (Hit hit in hits) {
				HTMLRenderSingleMailMessage (hit, color_band, xw);
				color_band = ! color_band;
			}

			xw.WriteEndElement (); // table
			xw.WriteEndElement (); // div

			// close the xhtml doc
			xw.Close ();

			// Console.WriteLine ("..Renderer: MailMessage.. elapsed time {0}", DateTime.Now - StartExec);

			return sw.ToString ();
		}