📄 rtfparser.cs
字号:
using System;
using System.Windows.Forms;
using ShootSearch.Plugin;
namespace ShootSearch.Plugin.RTF
{
/// <summary>
/// Parses RTF files.
/// </summary>
public class RTFParser : IParserPlugin
{
public RTFParser()
{
}
#region IParserPlugin Members
/// <summary>
/// This is the main parsing method. It extracts the plain text from a file.
/// </summary>
/// <param name="path">Full path to the file.</param>
/// <returns>Content of the file as plain text.</returns>
public string Extract(string path)
{
RichTextBox rtb = new RichTextBox();
rtb.LoadFile(path);
return rtb.Text;
}
/// <summary>
/// You can specify the analyzer to be used for files parsed by this plugin. If you return null the default analyzer (StandardAnalyzer) will be used.
/// </summary>
public Lucene.Net.Analysis.Analyzer Analyzer
{
get
{
return null;
}
}
/// <summary>
/// This property should return a field of all extensions handled by this plugin.
/// </summary>
public string[] Extensions
{
get
{
return new string[] {".rtf"};
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -