Compare commits
2 Commits
59776008d3
...
a5ed094f2d
Author | SHA1 | Date | |
---|---|---|---|
a5ed094f2d | |||
0c1fd59146 |
Binary file not shown.
@ -13,20 +13,27 @@ Global
|
|||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Test|Any CPU = Test|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Test|Any CPU.ActiveCfg = Test|Any CPU
|
||||||
|
{6CE536CB-6154-4FDF-9FFE-23A73B4E84AB}.Test|Any CPU.Build.0 = Test|Any CPU
|
||||||
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Test|Any CPU.ActiveCfg = Test|Any CPU
|
||||||
|
{455E23BE-F34F-4F6F-A9EA-381D66170B1B}.Test|Any CPU.Build.0 = Test|Any CPU
|
||||||
{FF204E99-82F8-405E-847B-88FC6DF07715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{FF204E99-82F8-405E-847B-88FC6DF07715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{FF204E99-82F8-405E-847B-88FC6DF07715}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{FF204E99-82F8-405E-847B-88FC6DF07715}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{FF204E99-82F8-405E-847B-88FC6DF07715}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{FF204E99-82F8-405E-847B-88FC6DF07715}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{FF204E99-82F8-405E-847B-88FC6DF07715}.Release|Any CPU.Build.0 = Release|Any CPU
|
{FF204E99-82F8-405E-847B-88FC6DF07715}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{FF204E99-82F8-405E-847B-88FC6DF07715}.Test|Any CPU.ActiveCfg = Test|Any CPU
|
||||||
|
{FF204E99-82F8-405E-847B-88FC6DF07715}.Test|Any CPU.Build.0 = Test|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -316,6 +316,20 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestCertificateThumbprint>62DF6B414BD2608A130540A801F32D12E0199A99</ManifestCertificateThumbprint>
|
<ManifestCertificateThumbprint>62DF6B414BD2608A130540A801F32D12E0199A99</ManifestCertificateThumbprint>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Test|AnyCPU'">
|
||||||
|
<OutputPath>bin\Test\</OutputPath>
|
||||||
|
<DefineConstants>VSTO40;TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Test|Win32'">
|
||||||
|
<OutputPath>bin\Win32\Test\</OutputPath>
|
||||||
|
<DefineConstants>VSTO40</DefineConstants>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
<!-- Include the build rules for a C# project. -->
|
<!-- Include the build rules for a C# project. -->
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- Include additional build rules for an Office application add-in. -->
|
<!-- Include additional build rules for an Office application add-in. -->
|
||||||
|
@ -8,6 +8,6 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
<StartAction>Project</StartAction>
|
<StartAction>Project</StartAction>
|
||||||
<StartProgram>C:\Soft\Kingsoft\WPS Office\12.1.0.16910\office6\wps.exe</StartProgram>
|
<StartProgram>C:\Soft\Kingsoft\WPS Office\12.1.0.16929\office6\wps.exe</StartProgram>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
@ -104,11 +104,13 @@ namespace AIProofread
|
|||||||
|
|
||||||
public void ShowCurrentPane()
|
public void ShowCurrentPane()
|
||||||
{
|
{
|
||||||
Globals.ThisAddIn.currentDocumentTaskPane.Visible = true;
|
Globals.ThisAddIn.ShowPanel();
|
||||||
|
//Globals.ThisAddIn.currentDocumentTaskPane.Visible = true;
|
||||||
}
|
}
|
||||||
public void HideCurrentPane()
|
public void HideCurrentPane()
|
||||||
{
|
{
|
||||||
Globals.ThisAddIn.currentDocumentTaskPane.Visible = false;
|
Globals.ThisAddIn.HidePanel();
|
||||||
|
//Globals.ThisAddIn.currentDocumentTaskPane.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Logout(string action)
|
public void Logout(string action)
|
||||||
@ -224,18 +226,24 @@ namespace AIProofread
|
|||||||
{
|
{
|
||||||
if (item.mark != null)
|
if (item.mark != null)
|
||||||
{
|
{
|
||||||
if(item.content.tag == "i" && item.content.isAccept == AcceptStatus.Default) {
|
if (item.content.tag == "i" && item.content.isAccept == AcceptStatus.Default)
|
||||||
|
{
|
||||||
item.mark.Text = "";
|
item.mark.Text = "";
|
||||||
}
|
}
|
||||||
item.ResetMarkStyle();
|
item.ResetMarkStyle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
marks.Clear();
|
|
||||||
DocumentUtil.ClearProofreadMarks();
|
DocumentUtil.ClearProofreadMarks();
|
||||||
}catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.Log("ClearAllProofreadMark",ex);
|
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Log("ClearAllProofreadMark", ex);
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 清空marks
|
||||||
|
marks.Clear();
|
||||||
|
}catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeBookmark(string markId)
|
public void removeBookmark(string markId)
|
||||||
@ -412,7 +420,7 @@ namespace AIProofread
|
|||||||
// 先滚动到可视区域
|
// 先滚动到可视区域
|
||||||
//doc.ActiveWindow.ScrollIntoView(mark.Range);
|
//doc.ActiveWindow.ScrollIntoView(mark.Range);
|
||||||
marks[proofreadId].Select();
|
marks[proofreadId].Select();
|
||||||
Globals.ThisAddIn.SendMessageToWeb("select", proofreadId);
|
//Globals.ThisAddIn.SendMessageToWeb("select", proofreadId);
|
||||||
}
|
}
|
||||||
Globals.ThisAddIn.SendMessageToWeb("select_proofread", proofreadId);
|
Globals.ThisAddIn.SendMessageToWeb("select_proofread", proofreadId);
|
||||||
}
|
}
|
||||||
@ -450,7 +458,8 @@ namespace AIProofread
|
|||||||
{
|
{
|
||||||
var mark = AddBookmark(item, index, correct.Sentence_offset, correct.Insert_len, correct.Paragraph_offset);
|
var mark = AddBookmark(item, index, correct.Sentence_offset, correct.Insert_len, correct.Paragraph_offset);
|
||||||
if (item.tag != "i") index++;
|
if (item.tag != "i") index++;
|
||||||
if (mark != null) {
|
if (mark != null)
|
||||||
|
{
|
||||||
marks.Add(item.id, new ProofreadItem(item, mark));
|
marks.Add(item.id, new ProofreadItem(item, mark));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,7 +467,7 @@ namespace AIProofread
|
|||||||
}
|
}
|
||||||
foreach (var item in marks)
|
foreach (var item in marks)
|
||||||
{
|
{
|
||||||
if(item.Value.mark != null)
|
if (item.Value.mark != null)
|
||||||
{
|
{
|
||||||
if (item.Value.content.tag == "i")
|
if (item.Value.content.tag == "i")
|
||||||
{
|
{
|
||||||
@ -472,7 +481,7 @@ namespace AIProofread
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string GetParagraph(int index)
|
public string GetParagraph(int index)
|
||||||
{
|
{
|
||||||
@ -496,61 +505,94 @@ namespace AIProofread
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Microsoft.Office.Tools.Word.Bookmark AddBookmark(CorrectedContent item, int findIndex, int offset, int length,int paragraphIndex)
|
public Microsoft.Office.Tools.Word.Bookmark AddBookmark(CorrectedContent item, int findIndex, int offset, int length, int paragraphIndex)
|
||||||
{
|
{
|
||||||
Microsoft.Office.Tools.Word.Bookmark bookmark = null;
|
Microsoft.Office.Tools.Word.Bookmark bookmark = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var document = Globals.ThisAddIn.Application.ActiveDocument;
|
var document = Globals.ThisAddIn.Application.ActiveDocument;
|
||||||
ControlCollection controls = Globals.Factory.GetVstoObject(document).Controls;
|
ControlCollection controls = Globals.Factory.GetVstoObject(document).Controls;
|
||||||
// 判断并获取当前段落
|
var markName = Config.BuildBookmarkName(item.id);
|
||||||
|
|
||||||
|
// 判断是否已经存在
|
||||||
|
if (controls.Contains(markName))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
controls.Remove(markName);
|
||||||
|
}catch (Exception) { }
|
||||||
|
}
|
||||||
|
Range findRange = null;
|
||||||
if (paragraphIndex > document.Paragraphs.Count) return null;
|
if (paragraphIndex > document.Paragraphs.Count) return null;
|
||||||
var paragraph = document.Paragraphs[paragraphIndex];
|
var paragraph = document.Paragraphs[paragraphIndex];
|
||||||
var paragraphStart = paragraph.Range.Start;
|
var paragraphStart = paragraph.Range.Start;
|
||||||
var Start = paragraphStart + offset;
|
offset += paragraphStart;
|
||||||
|
|
||||||
|
var Start = offset;
|
||||||
var End = Start + length - 1;
|
var End = Start + length - 1;
|
||||||
if(End > paragraph.Range.End)
|
if (End > paragraph.Range.End)
|
||||||
{
|
{
|
||||||
End = paragraph.Range.End;
|
End = paragraph.Range.End;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前句子的选区
|
// 当前句子的选区
|
||||||
var fullRange = document.Range(Start, End);
|
var fullRange = document.Range(Start, End);
|
||||||
string fullText = fullRange.Text;
|
string fullText = fullRange.Text ?? paragraph.Range.Text;
|
||||||
Start = paragraphStart + offset + item.start;
|
Start = offset + item.start;
|
||||||
End = paragraphStart + offset + item.end;
|
End = offset + item.end;
|
||||||
|
|
||||||
// 定位要操作的文字
|
// 如果是新增 只能使用接口数据
|
||||||
var r = document.Range(Start, End);
|
findRange = document.Range(Start, End);
|
||||||
var markName = Config.BuildBookmarkName(item.id);
|
if (item.tag != "i" && findRange.Text != item.origin)
|
||||||
|
|
||||||
// 判断是否已经存在
|
|
||||||
if (controls.Contains(markName))
|
|
||||||
{
|
{
|
||||||
controls.Remove(markName);
|
findRange = DocumentUtil.FindRange(paragraphIndex, item.origin, item.start, item.end);
|
||||||
}
|
}
|
||||||
// 判断选区是否正确
|
|
||||||
if (item.tag == "i" || r.Text == item.origin)
|
if (findRange != null)
|
||||||
{
|
{
|
||||||
bookmark = controls.AddBookmark(r, markName);
|
bookmark = controls.AddBookmark(findRange, markName);
|
||||||
bookmark.Tag = "ai_proofread";
|
bookmark.Tag = "ai_proofread";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
#region start
|
||||||
int startPos = 0, index, findCount = 0;
|
|
||||||
while ((index = fullText.IndexOf(item.origin, startPos)) != -1)
|
//// 判断并获取当前段落
|
||||||
{
|
|
||||||
if (findCount == findIndex)
|
|
||||||
{
|
//// 定位要操作的文字
|
||||||
r = document.Range(offset + index, offset + index + item.origin.Length);
|
//var r = document.Range(Start, End);
|
||||||
bookmark = controls.AddBookmark(r, markName);
|
|
||||||
bookmark.Tag = "ai_proofread";
|
//// 判断选区是否正确
|
||||||
break;
|
//if (item.tag == "i" || r.Text == item.origin)
|
||||||
}
|
//{
|
||||||
startPos = index;
|
// bookmark = controls.AddBookmark(r, markName);
|
||||||
findCount++;
|
// bookmark.Tag = "ai_proofread";
|
||||||
}
|
//}
|
||||||
}
|
//else
|
||||||
|
//{
|
||||||
|
// object str = item.origin;
|
||||||
|
// FindRange(ref fullRange, ref str);
|
||||||
|
|
||||||
|
// if(fullRange != null){
|
||||||
|
// bookmark = controls.AddBookmark(fullRange, markName);
|
||||||
|
// bookmark.Tag = "ai_proofread";
|
||||||
|
// }
|
||||||
|
// //int startPos = 0, index, findCount = 0;
|
||||||
|
// //while ((index = fullText.IndexOf(item.origin, startPos)) != -1)
|
||||||
|
// //{
|
||||||
|
// // if (findCount == findIndex)
|
||||||
|
// // {
|
||||||
|
// // r = document.Range(offset + index, offset + index + item.origin.Length);
|
||||||
|
// // if(r.Text == item.origin) { }
|
||||||
|
// // bookmark = controls.AddBookmark(r, markName);
|
||||||
|
// // bookmark.Tagetg = "ai_proofread";
|
||||||
|
// // break;
|
||||||
|
// // }
|
||||||
|
// // startPos = index;
|
||||||
|
// // findCount++;
|
||||||
|
// //}
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -560,5 +602,15 @@ namespace AIProofread
|
|||||||
return bookmark;
|
return bookmark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void FindRange(ref Range range,ref object whatToFind)
|
||||||
|
{
|
||||||
|
object matchCase = false; // 是否区分大小写
|
||||||
|
object matchWholeWord = false; // 是否匹配整个单词
|
||||||
|
object matchWildcards = false; // 是否使用通配符
|
||||||
|
object forward = true; // 搜索方向,true表示向前搜索,false表示向后搜索
|
||||||
|
object wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue; // 搜索范围,这里表示继续搜索
|
||||||
|
|
||||||
|
range.Find.Execute(ref whatToFind, ref matchCase, ref matchWholeWord, ref matchWildcards, ref forward, ref wrap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,17 +6,19 @@ namespace AIProofread
|
|||||||
public class Config
|
public class Config
|
||||||
{
|
{
|
||||||
public static readonly string APP_NAME = "AI校对王";
|
public static readonly string APP_NAME = "AI校对王";
|
||||||
public static readonly string APP_VERSION = "1.0.0";
|
public static readonly string APP_VERSION = "1.0.4";
|
||||||
public static bool IS_WPS = false;
|
public static bool IS_WPS = false;
|
||||||
|
|
||||||
|
public static readonly string CONFIG_FILE = AppDomain.CurrentDomain.BaseDirectory + "app.json";
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 网页访问地址
|
/// 网页访问地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string WEB_PATH = "http://192.168.10.100:5173/";
|
public static string WEB_PATH = "http://192.168.10.100:5173/";
|
||||||
public static readonly bool RUN_IN_DEBUG = true;
|
public static bool RUN_IN_DEBUG = true;
|
||||||
#else
|
#else
|
||||||
public static readonly string WEB_PATH = "https://gm-plugin.gachafun.com/";
|
public static string WEB_PATH = "https://gm-plugin.gachafun.com/";
|
||||||
public static readonly bool RUN_IN_DEBUG = false;
|
public static bool RUN_IN_DEBUG = false;
|
||||||
#endif
|
#endif
|
||||||
public static readonly string APP_DATA_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ai_proofread";
|
public static readonly string APP_DATA_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ai_proofread";
|
||||||
public static readonly string APP_LOG_PATH = APP_DATA_PATH + "\\logs\\";
|
public static readonly string APP_LOG_PATH = APP_DATA_PATH + "\\logs\\";
|
||||||
|
@ -36,5 +36,13 @@ namespace AIProofread.Controls
|
|||||||
{
|
{
|
||||||
return label1.Width;
|
return label1.Width;
|
||||||
}
|
}
|
||||||
|
public void ResetWeb()
|
||||||
|
{
|
||||||
|
if (!this.web.IsDisposed)
|
||||||
|
{
|
||||||
|
this.web.Stop();
|
||||||
|
this.web.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,9 @@ namespace AIProofread
|
|||||||
Directory.CreateDirectory(Config.APP_LOG_PATH);
|
Directory.CreateDirectory(Config.APP_LOG_PATH);
|
||||||
}
|
}
|
||||||
StreamWriter streamWriter = File.AppendText(path);
|
StreamWriter streamWriter = File.AppendText(path);
|
||||||
|
streamWriter.WriteLine("***************************[" + (Config.IS_WPS ? "WPS" : "WORD") + "]***************************");
|
||||||
streamWriter.WriteLine("消息:" + msg);
|
streamWriter.WriteLine("消息:" + msg);
|
||||||
streamWriter.WriteLine("时间:" + DateTime.Now.ToString("yyyy - MM - dd HH: mm:ss"));
|
streamWriter.WriteLine("时间:" + DateTime.Now.ToString("yyyy - MM - dd HH: mm:ss"));
|
||||||
streamWriter.WriteLine("***************************[" + (Config.IS_WPS?"WPS":"WORD")+ "]***************************");
|
|
||||||
streamWriter.WriteLine();
|
streamWriter.WriteLine();
|
||||||
streamWriter.Flush();
|
streamWriter.Flush();
|
||||||
streamWriter.Close();
|
streamWriter.Close();
|
||||||
|
@ -93,9 +93,14 @@ namespace UtilLib
|
|||||||
public void ResetMarkStyle()
|
public void ResetMarkStyle()
|
||||||
{
|
{
|
||||||
if (mark == null) return;
|
if (mark == null) return;
|
||||||
mark.Range.Font.Size = originSize; // 还原
|
if (mark.Range == null) return;
|
||||||
//mark.Range.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineNone;
|
try
|
||||||
mark.Range.Shading.BackgroundPatternColor = Microsoft.Office.Interop.Word.WdColor.wdColorAutomatic;
|
{
|
||||||
|
mark.Range.Font.Size = originSize; // 还原
|
||||||
|
//mark.Range.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineNone;
|
||||||
|
mark.Range.Shading.BackgroundPatternColor = Microsoft.Office.Interop.Word.WdColor.wdColorAutomatic;
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Process(int status)
|
public void Process(int status)
|
||||||
|
9
AIProofread/Ribbon1.Designer.cs
generated
9
AIProofread/Ribbon1.Designer.cs
generated
@ -51,6 +51,7 @@ namespace AIProofread
|
|||||||
this.grpDebug = this.Factory.CreateRibbonGroup();
|
this.grpDebug = this.Factory.CreateRibbonGroup();
|
||||||
this.btnShowPane = this.Factory.CreateRibbonButton();
|
this.btnShowPane = this.Factory.CreateRibbonButton();
|
||||||
this.btnHidePane = this.Factory.CreateRibbonButton();
|
this.btnHidePane = this.Factory.CreateRibbonButton();
|
||||||
|
this.btnTestLocation = this.Factory.CreateRibbonButton();
|
||||||
this.tabAIProofread.SuspendLayout();
|
this.tabAIProofread.SuspendLayout();
|
||||||
this.group1.SuspendLayout();
|
this.group1.SuspendLayout();
|
||||||
this.grpDebug.SuspendLayout();
|
this.grpDebug.SuspendLayout();
|
||||||
@ -167,6 +168,7 @@ namespace AIProofread
|
|||||||
//
|
//
|
||||||
this.grpDebug.Items.Add(this.btnShowPane);
|
this.grpDebug.Items.Add(this.btnShowPane);
|
||||||
this.grpDebug.Items.Add(this.btnHidePane);
|
this.grpDebug.Items.Add(this.btnHidePane);
|
||||||
|
this.grpDebug.Items.Add(this.btnTestLocation);
|
||||||
this.grpDebug.Label = "开发调试";
|
this.grpDebug.Label = "开发调试";
|
||||||
this.grpDebug.Name = "grpDebug";
|
this.grpDebug.Name = "grpDebug";
|
||||||
this.grpDebug.Visible = false;
|
this.grpDebug.Visible = false;
|
||||||
@ -183,6 +185,12 @@ namespace AIProofread
|
|||||||
this.btnHidePane.Name = "btnHidePane";
|
this.btnHidePane.Name = "btnHidePane";
|
||||||
this.btnHidePane.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnHidePane_Click);
|
this.btnHidePane.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnHidePane_Click);
|
||||||
//
|
//
|
||||||
|
// btnTestLocation
|
||||||
|
//
|
||||||
|
this.btnTestLocation.Label = "文本位置";
|
||||||
|
this.btnTestLocation.Name = "btnTestLocation";
|
||||||
|
this.btnTestLocation.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnTestLocation_Click);
|
||||||
|
//
|
||||||
// Ribbon1
|
// Ribbon1
|
||||||
//
|
//
|
||||||
this.Name = "Ribbon1";
|
this.Name = "Ribbon1";
|
||||||
@ -216,6 +224,7 @@ namespace AIProofread
|
|||||||
internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpDebug;
|
internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpDebug;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnShowPane;
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnShowPane;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnHidePane;
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnHidePane;
|
||||||
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnTestLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
partial class ThisRibbonCollection
|
partial class ThisRibbonCollection
|
||||||
|
@ -4,6 +4,8 @@ using System.Diagnostics;
|
|||||||
using AIProofread.Controls;
|
using AIProofread.Controls;
|
||||||
using UtilLib;
|
using UtilLib;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using Microsoft.Office.Interop.Word;
|
||||||
|
|
||||||
namespace AIProofread
|
namespace AIProofread
|
||||||
{
|
{
|
||||||
@ -17,7 +19,12 @@ namespace AIProofread
|
|||||||
//btnLogout.Label = "退出\n登录";
|
//btnLogout.Label = "退出\n登录";
|
||||||
|
|
||||||
Globals.ThisAddIn.ribbon = this;
|
Globals.ThisAddIn.ribbon = this;
|
||||||
if(Config.RUN_IN_DEBUG)
|
ShowDebug();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowDebug()
|
||||||
|
{
|
||||||
|
if (Config.RUN_IN_DEBUG)
|
||||||
{
|
{
|
||||||
grpDebug.Visible = true;
|
grpDebug.Visible = true;
|
||||||
}
|
}
|
||||||
@ -116,7 +123,8 @@ namespace AIProofread
|
|||||||
|
|
||||||
private void btnClear_Click(object sender, RibbonControlEventArgs e)
|
private void btnClear_Click(object sender, RibbonControlEventArgs e)
|
||||||
{
|
{
|
||||||
DocumentUtil.ClearProofreadMarks();
|
//DocumentUtil.ClearProofreadMarks();
|
||||||
|
Bridge.bridge.clearAllProofreadMark();
|
||||||
Globals.ThisAddIn.SendMessageToWeb("clear-tips", null);
|
Globals.ThisAddIn.SendMessageToWeb("clear-tips", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,5 +137,26 @@ namespace AIProofread
|
|||||||
{
|
{
|
||||||
Globals.ThisAddIn.HidePanel();
|
Globals.ThisAddIn.HidePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TestStr(int p, string str)
|
||||||
|
{
|
||||||
|
|
||||||
|
var doc = Globals.ThisAddIn.Application.ActiveDocument;
|
||||||
|
var p1 = doc.Paragraphs[p];
|
||||||
|
var text = p1.Range.Text;
|
||||||
|
var index = text.IndexOf(str);
|
||||||
|
var r = DocumentUtil.FindRange(p, str, index, index + str.Length);
|
||||||
|
|
||||||
|
System.Windows.Forms.MessageBox.Show("段落:" + p + str + ":" + index + (r == null ? "" : r.Text));
|
||||||
|
//var findRange = FindRange(p, findIndex, str, index, index + str.Length);
|
||||||
|
|
||||||
|
}
|
||||||
|
private void btnTestLocation_Click(object sender, RibbonControlEventArgs e)
|
||||||
|
{
|
||||||
|
TestStr(2, "销");
|
||||||
|
TestStr(3, "针");
|
||||||
|
TestStr(22, "疏");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ using System.Threading;
|
|||||||
using Microsoft.Office.Interop.Word;
|
using Microsoft.Office.Interop.Word;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace AIProofread
|
namespace AIProofread
|
||||||
{
|
{
|
||||||
@ -43,29 +44,19 @@ namespace AIProofread
|
|||||||
public List<FormLogin> LoginFormList = new List<FormLogin>();
|
public List<FormLogin> LoginFormList = new List<FormLogin>();
|
||||||
|
|
||||||
public Dictionary<Word.Document, CustomTaskPane> taskPanels = new Dictionary<Word.Document, CustomTaskPane>();
|
public Dictionary<Word.Document, CustomTaskPane> taskPanels = new Dictionary<Word.Document, CustomTaskPane>();
|
||||||
public Dictionary<Word.Document, bool> panelsVisible = new Dictionary<Word.Document, bool>();
|
public Dictionary<Word.Document, bool> panelsVisibleStatus = new Dictionary<Word.Document, bool>();
|
||||||
public CustomTaskPane currentDocumentTaskPane;
|
public CustomTaskPane currentDocumentTaskPane;
|
||||||
|
|
||||||
private static readonly Dictionary<Word.Document, Dictionary<int, ProofreadItem>> allMarks = new Dictionary<Word.Document, Dictionary<int, ProofreadItem>>();
|
private static readonly Dictionary<Word.Document, Dictionary<int, ProofreadItem>> allMarks = new Dictionary<Word.Document, Dictionary<int, ProofreadItem>>();
|
||||||
|
|
||||||
private void Application_WindowDeactivate(Word.Document doc, Window Wn)
|
private void Application_WindowDeactivate(Word.Document doc, Window Wn)
|
||||||
{
|
{
|
||||||
Logger.Log("Application_WindowDeactivate -- " + doc.FullName);
|
Logger.Log("Application_WindowDeactivate -- " + doc.FullName + " visible:");
|
||||||
//HidePanel(Doc);
|
//HidePanel(Doc);
|
||||||
if (taskPanels.ContainsKey(doc))
|
// 处理wps直接资源管理器新开文档面板闪烁问题
|
||||||
{
|
//if (IsWPS) {
|
||||||
var visible = taskPanels[doc].Visible;
|
// this.currentDocumentTaskPane.Visible = false;
|
||||||
// 记录当前文档的显示状态
|
//}
|
||||||
if (!panelsVisible.ContainsKey(doc))
|
|
||||||
{
|
|
||||||
panelsVisible.Add(doc, visible);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panelsVisible[doc] = visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Application_WindowActivate(Word.Document activeDoc, Window Wn)
|
private void Application_WindowActivate(Word.Document activeDoc, Window Wn)
|
||||||
@ -77,17 +68,19 @@ namespace AIProofread
|
|||||||
}
|
}
|
||||||
Logger.Log("Application_WindowActivate -- " + activeDoc.FullName);
|
Logger.Log("Application_WindowActivate -- " + activeDoc.FullName);
|
||||||
//ShowPanel(Doc);
|
//ShowPanel(Doc);
|
||||||
|
// 创建面板
|
||||||
if (!taskPanels.ContainsKey(activeDoc))
|
if (!taskPanels.ContainsKey(activeDoc))
|
||||||
{
|
{
|
||||||
ShowPanel(activeDoc, false);
|
ShowPanel(activeDoc, false);
|
||||||
|
panelsVisibleStatus.Add(activeDoc, false);
|
||||||
}
|
}
|
||||||
|
// 设置当前面板为新创建的面板
|
||||||
this.currentDocumentTaskPane = taskPanels[activeDoc];
|
this.currentDocumentTaskPane = taskPanels[activeDoc];
|
||||||
if (IsWPS)
|
if (IsWPS)
|
||||||
{
|
{
|
||||||
HideOtherPanel(activeDoc);
|
HideOtherPanel(activeDoc);
|
||||||
}
|
}
|
||||||
if (panelsVisible.ContainsKey(activeDoc) && panelsVisible[activeDoc])
|
if (panelsVisibleStatus.ContainsKey(activeDoc) && panelsVisibleStatus[activeDoc])
|
||||||
{
|
{
|
||||||
taskPanels[activeDoc].Visible = true;
|
taskPanels[activeDoc].Visible = true;
|
||||||
}
|
}
|
||||||
@ -128,8 +121,14 @@ namespace AIProofread
|
|||||||
}
|
}
|
||||||
void DisposePanel(Word.Document doc)
|
void DisposePanel(Word.Document doc)
|
||||||
{
|
{
|
||||||
|
if (panelsVisibleStatus.ContainsKey(doc))
|
||||||
|
{
|
||||||
|
panelsVisibleStatus.Remove(doc);
|
||||||
|
}
|
||||||
if (taskPanels.ContainsKey(doc))
|
if (taskPanels.ContainsKey(doc))
|
||||||
{
|
{
|
||||||
|
var control = (ProofreadMainControl)taskPanels[doc].Control;
|
||||||
|
control.ResetWeb();
|
||||||
taskPanels[doc].Visible = false;
|
taskPanels[doc].Visible = false;
|
||||||
taskPanels[doc].Dispose();
|
taskPanels[doc].Dispose();
|
||||||
taskPanels.Remove(doc);
|
taskPanels.Remove(doc);
|
||||||
@ -142,9 +141,14 @@ namespace AIProofread
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 隐藏其他的文档
|
||||||
foreach (var key in taskPanels.Keys)
|
foreach (var key in taskPanels.Keys)
|
||||||
{
|
{
|
||||||
taskPanels[key].Visible = false;
|
// 记录面板原始状态
|
||||||
|
if (key != doc)
|
||||||
|
{
|
||||||
|
taskPanels[key].Visible = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,10 +234,37 @@ namespace AIProofread
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
private void InitAppByConfig()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (File.Exists(Config.CONFIG_FILE))
|
||||||
|
{
|
||||||
|
string content = File.ReadAllText(Config.CONFIG_FILE);
|
||||||
|
Logger.Log("Found app.json " + content);
|
||||||
|
if (content == null || content.Length == 0) return;
|
||||||
|
AppConfig config = JsonConvert.DeserializeObject<AppConfig>(content);
|
||||||
|
if (config.AppUrl?.Length > 0)
|
||||||
|
{
|
||||||
|
Config.WEB_PATH = config.AppUrl;
|
||||||
|
}
|
||||||
|
if (config.AppRunInDebug)
|
||||||
|
{
|
||||||
|
Config.RUN_IN_DEBUG = config.AppRunInDebug;
|
||||||
|
if(this.ribbon != null)
|
||||||
|
{
|
||||||
|
this.ribbon.ShowDebug();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
private void ThisAddIn_Startup(object sender, System.EventArgs e)
|
private void ThisAddIn_Startup(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
InitAppByConfig();
|
||||||
FmainThreadContext = SynchronizationContext.Current;
|
FmainThreadContext = SynchronizationContext.Current;
|
||||||
// 启动地址
|
// 启动地址
|
||||||
applicationStartupPath = System.Windows.Forms.Application.StartupPath;
|
applicationStartupPath = System.Windows.Forms.Application.StartupPath;
|
||||||
@ -336,12 +367,20 @@ namespace AIProofread
|
|||||||
public void ShowPanel()
|
public void ShowPanel()
|
||||||
{
|
{
|
||||||
this.currentDocumentTaskPane.Visible = true;
|
this.currentDocumentTaskPane.Visible = true;
|
||||||
|
if (panelsVisibleStatus.ContainsKey(Application.ActiveDocument))
|
||||||
|
{
|
||||||
|
panelsVisibleStatus[Application.ActiveDocument] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 隐藏面板
|
// 隐藏面板
|
||||||
public void HidePanel()
|
public void HidePanel()
|
||||||
{
|
{
|
||||||
this.currentDocumentTaskPane.Visible = false;
|
this.currentDocumentTaskPane.Visible = false;
|
||||||
|
if (panelsVisibleStatus.ContainsKey(Application.ActiveDocument))
|
||||||
|
{
|
||||||
|
panelsVisibleStatus[Application.ActiveDocument] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -8,6 +8,7 @@ using Bookmark = Microsoft.Office.Tools.Word.Bookmark;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.Office.Tools.Word;
|
using Microsoft.Office.Tools.Word;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace AIProofread
|
namespace AIProofread
|
||||||
{
|
{
|
||||||
@ -85,8 +86,9 @@ namespace AIProofread
|
|||||||
|
|
||||||
public static void ClearProofreadMarks()
|
public static void ClearProofreadMarks()
|
||||||
{
|
{
|
||||||
var bookmarks = Globals.ThisAddIn.Application.ActiveDocument.Bookmarks;
|
var document = Globals.ThisAddIn.Application.ActiveDocument;
|
||||||
ControlCollection controls = Globals.Factory.GetVstoObject(Globals.ThisAddIn.Application.ActiveDocument).Controls;
|
var bookmarks = document.Bookmarks;
|
||||||
|
ControlCollection controls = Globals.Factory.GetVstoObject(document).Controls;
|
||||||
foreach (Microsoft.Office.Interop.Word.Bookmark mark in bookmarks)
|
foreach (Microsoft.Office.Interop.Word.Bookmark mark in bookmarks)
|
||||||
{
|
{
|
||||||
if (Config.IsProofreadMark(mark.Name))
|
if (Config.IsProofreadMark(mark.Name))
|
||||||
@ -94,18 +96,15 @@ namespace AIProofread
|
|||||||
// 去除高亮
|
// 去除高亮
|
||||||
mark.Range.Shading.BackgroundPatternColor = WdColor.wdColorAutomatic;
|
mark.Range.Shading.BackgroundPatternColor = WdColor.wdColorAutomatic;
|
||||||
// 去除下划线
|
// 去除下划线
|
||||||
mark.Range.Underline = WdUnderline.wdUnderlineNone;
|
//mark.Range.Underline = WdUnderline.wdUnderlineNone;
|
||||||
//mark.Delete();
|
try
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (controls.Contains(mark))
|
|
||||||
{
|
{
|
||||||
controls.Remove(mark);
|
mark.Delete();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Log("remove mark", e);
|
||||||
}
|
}
|
||||||
}catch(Exception e)
|
|
||||||
{
|
|
||||||
Logger.Log("remove mark",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,5 +158,126 @@ namespace AIProofread
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找对应段落的range
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paragraphsIndex">段落index,从第1开始计数</param>
|
||||||
|
/// <param name="findText">要查找字符串</param>
|
||||||
|
/// <param name="wordStart">字符串原始起始位置</param>
|
||||||
|
/// <param name="wordEnd">字符串原始结束位置</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Range FindRange(int paragraphsIndex, string findText, int wordStart, int wordEnd)
|
||||||
|
{
|
||||||
|
// <param name="findIndex"></param> 暂时接口无法支持
|
||||||
|
var document = Globals.ThisAddIn.Application.ActiveDocument;
|
||||||
|
if (paragraphsIndex > document.Paragraphs.Count) return null;
|
||||||
|
var paragraph = document.Paragraphs[paragraphsIndex];
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//int num = 0;
|
||||||
|
int num3 = 0;
|
||||||
|
|
||||||
|
// 段落开始和结束
|
||||||
|
object Start = paragraph.Range.Start;
|
||||||
|
object End = paragraph.Range.End;
|
||||||
|
|
||||||
|
// 段落选区
|
||||||
|
Range range = document.Range(ref Start, ref End);
|
||||||
|
|
||||||
|
var activeDocument = document;
|
||||||
|
// 查找对象位置
|
||||||
|
End = range.Start + wordStart;
|
||||||
|
Start = range.Start + wordEnd;
|
||||||
|
// 直接找到
|
||||||
|
var findRange = activeDocument.Range(ref End, ref Start);
|
||||||
|
// 判断对应选区是否是要找的文本
|
||||||
|
if (findRange.Text == findText)
|
||||||
|
{
|
||||||
|
return findRange;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 查找
|
||||||
|
range.Find.MatchByte = true;
|
||||||
|
// 使用选区查找功能
|
||||||
|
Find find = range.Find;
|
||||||
|
// 节约变量
|
||||||
|
End = findText;
|
||||||
|
Start = true;
|
||||||
|
|
||||||
|
object MatchWholeWord = Type.Missing;
|
||||||
|
object MatchWildcards = Type.Missing;
|
||||||
|
object MatchSoundsLike = Type.Missing;
|
||||||
|
object MatchAllWordForms = Type.Missing;
|
||||||
|
object Forward = Type.Missing;
|
||||||
|
object Wrap = Type.Missing;
|
||||||
|
object Format = Type.Missing;
|
||||||
|
object ReplaceWith = Type.Missing;
|
||||||
|
object Replace = Type.Missing;
|
||||||
|
object MatchKashida = Type.Missing;
|
||||||
|
object MatchDiacritics = Type.Missing;
|
||||||
|
object MatchAlefHamza = Type.Missing;
|
||||||
|
object MatchControl = Type.Missing;
|
||||||
|
|
||||||
|
// 没有找到则执行查询
|
||||||
|
find.Execute(
|
||||||
|
ref End, ref Start, ref MatchWholeWord,
|
||||||
|
ref MatchWildcards, ref MatchSoundsLike,
|
||||||
|
ref MatchAllWordForms, ref Forward, ref Wrap,
|
||||||
|
ref Format, ref ReplaceWith, ref Replace,
|
||||||
|
ref MatchKashida, ref MatchDiacritics,
|
||||||
|
ref MatchAlefHamza, ref MatchControl
|
||||||
|
);
|
||||||
|
|
||||||
|
while (range.Find.Found)
|
||||||
|
{
|
||||||
|
var obj4 = range.Document;
|
||||||
|
MatchControl = range.Start;
|
||||||
|
MatchAlefHamza = range.End;
|
||||||
|
var range2 = obj4.Range(ref MatchControl, ref MatchAlefHamza);
|
||||||
|
num3 = range2.End;
|
||||||
|
if (range2.Text == findText)
|
||||||
|
{
|
||||||
|
return range2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//if (findIndex == num)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//num++;
|
||||||
|
//range.Find.MatchByte = true;
|
||||||
|
//Find find2 = range.Find;
|
||||||
|
//MatchAlefHamza = missword;
|
||||||
|
//MatchControl = true;
|
||||||
|
//MatchDiacritics = Type.Missing;
|
||||||
|
//MatchKashida = Type.Missing;
|
||||||
|
//Replace = Type.Missing;
|
||||||
|
//ReplaceWith = Type.Missing;
|
||||||
|
//Format = Type.Missing;
|
||||||
|
//Wrap = Type.Missing;
|
||||||
|
//Forward = Type.Missing;
|
||||||
|
//MatchAllWordForms = Type.Missing;
|
||||||
|
//MatchSoundsLike = Type.Missing;
|
||||||
|
//MatchWildcards = Type.Missing;
|
||||||
|
//MatchWholeWord = Type.Missing;
|
||||||
|
//Start = Type.Missing;
|
||||||
|
//End = Type.Missing;
|
||||||
|
//// 再次重复查找
|
||||||
|
//find2.Execute(ref MatchAlefHamza, ref MatchControl, ref MatchDiacritics, ref MatchKashida, ref Replace, ref ReplaceWith, ref Format, ref Wrap, ref Forward, ref MatchAllWordForms, ref MatchSoundsLike, ref MatchWildcards, ref MatchWholeWord, ref Start, ref End);
|
||||||
|
}
|
||||||
|
if (num3 == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
|
BIN
AIProofread/obj/Test/AIProofread.csproj.AssemblyReference.cache
Normal file
BIN
AIProofread/obj/Test/AIProofread.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
BIN
AIProofread/obj/Test/DesignTimeResolveAssemblyReferences.cache
Normal file
BIN
AIProofread/obj/Test/DesignTimeResolveAssemblyReferences.cache
Normal file
Binary file not shown.
Binary file not shown.
BIN
AIProofread/obj/Test/TempPE/Properties.Resources.Designer.cs.dll
Normal file
BIN
AIProofread/obj/Test/TempPE/Properties.Resources.Designer.cs.dll
Normal file
Binary file not shown.
0
AIProofread/obj/Test/build.force
Normal file
0
AIProofread/obj/Test/build.force
Normal file
9
util-lib/AppConfig.cs
Normal file
9
util-lib/AppConfig.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
namespace UtilLib
|
||||||
|
{
|
||||||
|
public class AppConfig
|
||||||
|
{
|
||||||
|
public string AppUrl { get; set; }
|
||||||
|
public bool AppRunInDebug { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
|
BIN
util-lib/obj/Test/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
BIN
util-lib/obj/Test/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
Binary file not shown.
BIN
util-lib/obj/Test/util-lib.csproj.AssemblyReference.cache
Normal file
BIN
util-lib/obj/Test/util-lib.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@ -30,6 +30,15 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Test|AnyCPU'">
|
||||||
|
<OutputPath>bin\Test\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@ -43,6 +52,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AcceptEnum.cs" />
|
<Compile Include="AcceptEnum.cs" />
|
||||||
|
<Compile Include="AppConfig.cs" />
|
||||||
<Compile Include="Colors.cs" />
|
<Compile Include="Colors.cs" />
|
||||||
<Compile Include="CorrectedContent.cs" />
|
<Compile Include="CorrectedContent.cs" />
|
||||||
<Compile Include="DocumentCorrectItem.cs" />
|
<Compile Include="DocumentCorrectItem.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user