📄 rtfcolortable.cs
字号:
using System;
using System.Collections;
using System.Drawing;
namespace RichTextBoxSupportsXHTML
{
/// <summary>
/// Summary description for RtfColorTable.
/// </summary>
public class RtfColorTable
{
private int numberOfColors = 0;
private string colortbl;
private Hashtable loadedColors = new Hashtable();
public RtfColorTable()
{
//
// TODO: Add constructor logic here
//
colortbl = "{\\colortbl;";
}
public int UseColor(Color key)
{
if (loadedColors.ContainsKey(key))
{
return (int)loadedColors[key];
}
else
{
colortbl += "\\red" + key.R + "\\green" + key.G + "\\blue" + key.B + ";";
loadedColors.Add(key, ++numberOfColors);
return numberOfColors;
}
}
public override string ToString()
{
return colortbl + "}";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -