1 Star 5 Fork 1

风铃 / WordRegexAddIn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
RegexRibbon.cs 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
using Microsoft.Office.Tools.Ribbon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace WordRegexAddIn
{
public partial class RegexRibbon
{
private RegexFinder finder;
private void RegexRibbon_Load(object sender, RibbonUIEventArgs e)
{
finder = new RegexFinder(Globals.ThisAddIn.Application);
}
private void btnFind_Click(object sender, RibbonControlEventArgs e)
{
finder.Find(editRegex.Text);
}
private void checkIgnoreCase_Click(object sender, RibbonControlEventArgs e)
{
if (checkIgnoreCase.Checked)
{
finder.Options |= RegexOptions.IgnoreCase;
}
else
{
finder.Options &= ~RegexOptions.IgnoreCase;
}
}
private void btnFindPrev_Click(object sender, RibbonControlEventArgs e)
{
finder.Previous(editRegex.Text);
}
private void btnReplace_Click(object sender, RibbonControlEventArgs e)
{
finder.Replace(editRegex.Text, editReplace.Text);
}
private void btnReplaceAll_Click(object sender, RibbonControlEventArgs e)
{
finder.ReplaceAll(editRegex.Text, editReplace.Text);
}
private void btnHelp_Click(object sender, RibbonControlEventArgs e)
{
System.Diagnostics.Process.Start("https://gitee.com/fldx/WordRegexAddIn");
}
private void btnUpdate_Click(object sender, RibbonControlEventArgs e)
{
System.Diagnostics.Process.Start("https://gitee.com/fldx/WordRegexAddIn/releases");
}
private void group1_DialogLauncherClick(object sender, RibbonControlEventArgs e)
{
}
}
}
C#
1
https://gitee.com/fldx/WordRegexAddIn.git
git@gitee.com:fldx/WordRegexAddIn.git
fldx
WordRegexAddIn
WordRegexAddIn
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891