");
else
Out("
");
foreach (Row r in doc)
{
i++;
if (r.CanFold)
{
RenderCollapsed(r.VirtualCollapsedRow, r, i, ImagePath, guid);
Out(" ");
string img = "minus.gif";
try
{
if (r.expansion_StartSpan.Parent.Parent == null)
img = "minusNoTopLine.gif";
}
catch {}
Out("  ");
}
else
{
if (r.CanFoldEndPart)
{
Out("  ");
}
else
{
if (r.HasExpansionLine)
{
Out("  ");
}
else
{
Out("  ");
}
}
}
foreach (Word w in r)
{
write(w.Text, w.Style);
}
if (r.CanFoldEndPart)
Out(" \n");
else
Out(" \n");
}
Out(" |
");
return sb.ToString();
}
private void RenderCollapsed(Row r, Row TrueRow, int i, string ImagePath,
string guid)
{
Out("
");
string img = "plus.gif";
try
{
if (TrueRow.expansion_StartSpan.Parent.Parent == null)
img = "PlusNoLines.gif";
}
catch {}
Out("

");
foreach (Word w in r)
{
write(w.Text, w.Style);
}
Out("
");
}
private void write(string text, TextStyle s)
{
if (s != null)
{
if (s.Bold)
Out("
");
if (s.Italic)
Out("");
if (s.Transparent)
Out("");
else
Out("");
}
text = text.Replace("&", "&");
text = text.Replace("<", "<");
text = text.Replace(">", ">");
text = text.Replace(" ", " ");
text = text.Replace("\t", " ");
Out(text);
if (s != null)
{
Out("");
if (s.Italic)
Out("");
if (s.Bold)
Out("");
}
}
private static string GetHTMLColor(Color c)
{
return string.Format("#{0}{1}{2}", c.R.ToString("x2"), c.G.ToString("x2"),
c.B.ToString("x2"));
}
private void Out(string text)
{
sb.Append(text);
}
}
}