-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathHtmlUtility.cs
More file actions
37 lines (34 loc) · 1.06 KB
/
HtmlUtility.cs
File metadata and controls
37 lines (34 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace BitDiffer.Common.Utility
{
public class HtmlUtility
{
public static void WriteHtmlStart(TextWriter tw)
{
tw.Write("<html><head><style type='text/css'><!-- ");
tw.Write(".hdr { font-weight:bold;background-color:#F0F0FF;padding:5 2 5 2; } ");
tw.Write(".hdr1 { font-weight:bold;background-color:#B5D2FF;padding:5 2 5 2; } ");
tw.Write(".hdr2 { font-weight:bold; } ");
tw.Write(".code { font-family:consolas, 'courier new'; } ");
tw.Write(".keyword { color:blue; } ");
tw.Write(".brkchg { color:red; } ");
tw.Write(".usertype { color:#2B91AF; } ");
tw.Write(".string { color:#A31515; } ");
tw.Write(".visibility { color:blue; } ");
tw.Write("--></style></head><body style='font-family:Tahoma;font-size:9pt'>");
}
public static void WriteHtmlEnd(TextWriter tw)
{
tw.Write("</body></html>");
}
public static string HtmlEncode(string text)
{
text = text.Replace("<", "<");
text = text.Replace(">", ">");
return text;
}
}
}