Compare commits
3 Commits
8ab9a209e5
...
59ebe8a18d
Author | SHA1 | Date | |
---|---|---|---|
59ebe8a18d | |||
753094447a | |||
d132bbfa3a |
@ -344,6 +344,12 @@
|
||||
<Compile Include="Controls\FormWebView.Designer.cs">
|
||||
<DependentUpon>FormWebView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\MessageTips.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\MessageTips.Designer.cs">
|
||||
<DependentUpon>MessageTips.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ProofreadMainControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@ -365,6 +371,8 @@
|
||||
<Compile Include="Model\DocumentContent.cs" />
|
||||
<Compile Include="Model\DocumentInfo.cs" />
|
||||
<Compile Include="Model\DocumentList.cs" />
|
||||
<Compile Include="Model\ExportDataItem.cs" />
|
||||
<Compile Include="Model\InsertMarkData.cs" />
|
||||
<Compile Include="ProofreadItem.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
@ -403,6 +411,9 @@
|
||||
<EmbeddedResource Include="Controls\FormWebView.resx">
|
||||
<DependentUpon>FormWebView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\MessageTips.resx">
|
||||
<DependentUpon>MessageTips.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\ProofreadMainControl.resx">
|
||||
<DependentUpon>ProofreadMainControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@ -499,6 +510,18 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\icon_close.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\logo_wps.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\logo_no_text.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\logo_no_text_wps.jpg" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
@ -52,33 +52,34 @@ namespace AIProofread
|
||||
|
||||
public void ShowUpgradeView()
|
||||
{
|
||||
if (CurrentUpgrade == null)
|
||||
{
|
||||
CheckPluginUpgrade();
|
||||
if (CurrentUpgrade == null)
|
||||
{
|
||||
showDialog("获取版本信息失败,请稍后再试");
|
||||
return;
|
||||
}
|
||||
}
|
||||
var needUpgrade = CurrentUpgrade.NeedUpgrade(Config.APP_VERSION);
|
||||
if (!needUpgrade)
|
||||
{
|
||||
showDialog("当前版本为最新版本,无需升级");
|
||||
return;
|
||||
}
|
||||
if (CurrentUpgrade.Ext == 1)
|
||||
{
|
||||
var ret = MessageBox.Show(CurrentUpgrade.Message, "是否确认更新", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
|
||||
if (ret == DialogResult.Yes)
|
||||
{
|
||||
OpenUrlWithOsBrowser(CurrentUpgrade.DownloadUrl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StartUpgradeProcess();
|
||||
}
|
||||
// 统一使用更新程序
|
||||
StartUpgradeProcess();
|
||||
//if (CurrentUpgrade == null)
|
||||
//{
|
||||
// CheckPluginUpgrade();
|
||||
// if (CurrentUpgrade == null)
|
||||
// {
|
||||
// showDialog("获取版本信息失败,请稍后再试");
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
//var needUpgrade = CurrentUpgrade.NeedUpgrade(Config.APP_VERSION);
|
||||
//if (!needUpgrade)
|
||||
//{
|
||||
// showDialog("当前版本为最新版本,无需升级");
|
||||
// return;
|
||||
//}
|
||||
//if (CurrentUpgrade.Ext == 1)
|
||||
//{
|
||||
// var ret = MessageBox.Show(CurrentUpgrade.Message, "是否确认更新", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
|
||||
// if (ret == DialogResult.Yes)
|
||||
// {
|
||||
// OpenUrlWithOsBrowser(CurrentUpgrade.DownloadUrl);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//}
|
||||
}
|
||||
|
||||
public bool ShouldUpgradeForced()
|
||||
@ -135,7 +136,7 @@ namespace AIProofread
|
||||
Globals.ThisAddIn.ribbon.SetBtnStatus(key, status);
|
||||
}
|
||||
|
||||
public void showDialog(string message, string confirmText = "", string confirmAction = "")
|
||||
public void ShowDialog(string message, string confirmText = "", string confirmAction = "")
|
||||
{
|
||||
Globals.ThisAddIn.ActiveDocument?.ShowDialog(message, confirmText, confirmAction);
|
||||
}
|
||||
@ -205,7 +206,7 @@ namespace AIProofread
|
||||
}
|
||||
catch
|
||||
{
|
||||
showDialog("打开网页失败");
|
||||
ShowDialog("打开网页失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,6 +246,10 @@ namespace AIProofread
|
||||
Globals.ThisAddIn.HidePanel();
|
||||
}
|
||||
|
||||
public void ShowLog(string message)
|
||||
{
|
||||
Logger.Log((Config.IS_WPS ? "WPS" : "WORD") + "-WEB", message);
|
||||
}
|
||||
|
||||
public void ShowLoginForm(string action)
|
||||
{
|
||||
@ -527,8 +532,12 @@ namespace AIProofread
|
||||
}
|
||||
public void ShowSettingForm()
|
||||
{
|
||||
FormSetting frm = new FormSetting();
|
||||
frm.Show();
|
||||
Globals.ThisAddIn.ActiveDocument.ShowSetting();
|
||||
}
|
||||
|
||||
public void ShowWebView(string url, int width, int height, bool dialog)
|
||||
{
|
||||
Globals.ThisAddIn.ActiveDocument.ShowWebView(url, width, height, dialog);
|
||||
}
|
||||
|
||||
public void MoveCursor(int pos)
|
||||
@ -556,7 +565,7 @@ namespace AIProofread
|
||||
try
|
||||
{
|
||||
// 根据文档编号 获取当前文档避免数据混乱
|
||||
var document = Globals.ThisAddIn.GetDocumentById(documentId) ?? throw new Exception("没有找到校对文档对象");
|
||||
var document = documentId < 1 ? Globals.ThisAddIn.ActiveDocument :(Globals.ThisAddIn.GetDocumentById(documentId) ?? throw new Exception("没有找到校对文档对象"));
|
||||
|
||||
// 先清除所有数据
|
||||
if (clearOriginMark) document.ClearAllProofreadMark();
|
||||
@ -582,9 +591,14 @@ namespace AIProofread
|
||||
return InitContent(content, documentId, false);
|
||||
}
|
||||
|
||||
public void ShowMessage(string message,int closeDelay=1000)
|
||||
{
|
||||
//FormMessage.ShowMessage(message, closeDelay);
|
||||
Globals.ThisAddIn.ActiveDocument?.ShowMessage(message, closeDelay);
|
||||
}
|
||||
public string ShowDialogMessage(string message)
|
||||
{
|
||||
var result = FormMessage.ShowMessage(message);
|
||||
var result = FormMessage.ShowMessage(message, "确认",null);
|
||||
if (result == DialogResult.Retry)
|
||||
{
|
||||
return "retry";
|
||||
@ -606,6 +620,10 @@ namespace AIProofread
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出勘误表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ExportProofreadResult()
|
||||
{
|
||||
try
|
||||
@ -641,6 +659,10 @@ namespace AIProofread
|
||||
public string SaveCache(int documentId, string cache, bool silent)
|
||||
{
|
||||
var document = Globals.ThisAddIn.GetDocumentById(documentId);
|
||||
if (document == null)
|
||||
{
|
||||
return BridgeResult.Success("ok");
|
||||
}
|
||||
if (!silent)
|
||||
{
|
||||
if (!document.CurrentDocument.Saved)
|
||||
@ -727,11 +749,28 @@ namespace AIProofread
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCurrentDocumentProofreadStatus(int documentId,bool status)
|
||||
public void SetCurrentDocumentProofreadStatus(int documentId, bool proofread, bool proofreading, bool checkIsActive = false)
|
||||
{
|
||||
|
||||
if (documentId < 1) return;
|
||||
var document = Globals.ThisAddIn.GetDocumentById(documentId);
|
||||
document.Proofreading = status;
|
||||
if (document != null)
|
||||
{
|
||||
document.Proofread = proofread;
|
||||
document.Proofreading = proofreading;
|
||||
if (checkIsActive && documentId != Globals.ThisAddIn.ActiveDocument.Id) return;
|
||||
document.CheckBtnStatus();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置当前文档的校对状态
|
||||
/// </summary>
|
||||
/// <param name="documentId"></param>
|
||||
/// <param name="proofread"></param>
|
||||
/// <param name="proofreading"></param>
|
||||
public void SetCurrentDocumentProofreadStatus(int documentId, bool proofread, bool proofreading)
|
||||
{
|
||||
SetCurrentDocumentProofreadStatus(documentId, proofread, proofreading, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,10 +12,10 @@ namespace AIProofread
|
||||
public class Config
|
||||
{
|
||||
public static readonly string APP_NAME = "AI校对王";
|
||||
public static readonly string APP_VERSION = "2.0.0";
|
||||
public static readonly string APP_VERSION = "2.0.3";
|
||||
public static bool IS_WPS = false;
|
||||
public static bool UpgradeForcedNotice = false;
|
||||
|
||||
public static readonly string APP_BASE_DIR = AppDomain.CurrentDomain.BaseDirectory;
|
||||
public static readonly string CONFIG_FILE = AppDomain.CurrentDomain.BaseDirectory + "app.json";
|
||||
/// <summary>
|
||||
/// 文本背景色
|
||||
@ -25,11 +25,11 @@ namespace AIProofread
|
||||
/// <summary>
|
||||
/// 网页访问地址
|
||||
/// </summary>
|
||||
public static string WEB_PATH = "http://192.168.10.100:5173/"; //192.168.0.231:5137 192.168.10.100:5173 gm2-plugin.zverse.group
|
||||
public static bool RUN_IN_DEBUG = false;
|
||||
public static AppEnvironment APP_ENV = AppEnvironment.Prod;
|
||||
public static string WEB_PATH = "https://pre-gm-plugin.gachafun.com/"; //pre-gm-plugin.gachafun.com 192.168.0.231:5137 192.168.10.100:5173 gm2-plugin.zverse.group
|
||||
public static bool RUN_IN_DEBUG = true;
|
||||
public static AppEnvironment APP_ENV = AppEnvironment.Dev;
|
||||
#else
|
||||
public static string WEB_PATH = "https://gm-plugin.gachafun.com/";
|
||||
public static string WEB_PATH = "https://pre-gm-plugin.gachafun.com/";
|
||||
public static bool RUN_IN_DEBUG = false;
|
||||
public static AppEnvironment APP_ENV = AppEnvironment.Prod;
|
||||
#endif
|
||||
|
14
AIProofread/Controls/FormMessage.Designer.cs
generated
@ -44,7 +44,7 @@
|
||||
this.LblMeesage.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.LblMeesage.Location = new System.Drawing.Point(30, 60);
|
||||
this.LblMeesage.Name = "LblMeesage";
|
||||
this.LblMeesage.Size = new System.Drawing.Size(320, 140);
|
||||
this.LblMeesage.Size = new System.Drawing.Size(320, 70);
|
||||
this.LblMeesage.TabIndex = 4;
|
||||
this.LblMeesage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
@ -70,6 +70,7 @@
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(380, 46);
|
||||
this.panel1.TabIndex = 3;
|
||||
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
@ -81,12 +82,13 @@
|
||||
this.label1.Size = new System.Drawing.Size(74, 21);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "温馨提示";
|
||||
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);
|
||||
//
|
||||
// BtnClose
|
||||
//
|
||||
this.BtnClose.BackColor = System.Drawing.Color.White;
|
||||
this.BtnClose.BackgroundImage = global::AIProofread.Properties.Resources.button_default;
|
||||
this.BtnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.BtnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||
this.BtnClose.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.BtnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.BtnClose.FlatAppearance.BorderColor = System.Drawing.Color.Gainsboro;
|
||||
@ -96,7 +98,7 @@
|
||||
this.BtnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnClose.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.BtnClose.ForeColor = System.Drawing.Color.Black;
|
||||
this.BtnClose.Location = new System.Drawing.Point(200, 214);
|
||||
this.BtnClose.Location = new System.Drawing.Point(200, 150);
|
||||
this.BtnClose.Name = "BtnClose";
|
||||
this.BtnClose.Size = new System.Drawing.Size(120, 44);
|
||||
this.BtnClose.TabIndex = 2;
|
||||
@ -107,7 +109,7 @@
|
||||
// BtnConfirm
|
||||
//
|
||||
this.BtnConfirm.BackgroundImage = global::AIProofread.Properties.Resources.button;
|
||||
this.BtnConfirm.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.BtnConfirm.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||
this.BtnConfirm.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.BtnConfirm.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.BtnConfirm.FlatAppearance.BorderSize = 0;
|
||||
@ -116,7 +118,7 @@
|
||||
this.BtnConfirm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnConfirm.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.BtnConfirm.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnConfirm.Location = new System.Drawing.Point(60, 214);
|
||||
this.BtnConfirm.Location = new System.Drawing.Point(60, 150);
|
||||
this.BtnConfirm.Name = "BtnConfirm";
|
||||
this.BtnConfirm.Size = new System.Drawing.Size(120, 44);
|
||||
this.BtnConfirm.TabIndex = 1;
|
||||
@ -129,7 +131,7 @@
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(380, 286);
|
||||
this.ClientSize = new System.Drawing.Size(380, 216);
|
||||
this.Controls.Add(this.LblMeesage);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.BtnClose);
|
||||
|
@ -1,10 +1,24 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AIProofread.Controls
|
||||
{
|
||||
public partial class FormMessage : BaseWinForm
|
||||
{
|
||||
public const int WM_NCLBUTTONDOWN = 0xA1;
|
||||
public const int HT_CAPTION = 0x2;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool ReleaseCapture();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化宽度
|
||||
/// </summary>
|
||||
private const int INIT_WIDTH = 380;
|
||||
|
||||
public FormMessage()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -37,26 +51,46 @@ namespace AIProofread.Controls
|
||||
), BtnClose.Location.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算缩放
|
||||
/// </summary>
|
||||
/// <param name="size"></param>
|
||||
/// <returns></returns>
|
||||
private int ScaleSize(int size)
|
||||
{
|
||||
return (int)(size * this.Width * 1.0 / INIT_WIDTH);
|
||||
}
|
||||
|
||||
private void ResetButtons()
|
||||
{
|
||||
BtnClose.Location = new System.Drawing.Point(200, BtnClose.Location.Y);
|
||||
BtnConfirm.Location = new System.Drawing.Point(60, BtnConfirm.Location.Y);
|
||||
BtnClose.Location = new System.Drawing.Point(ScaleSize(200), BtnClose.Location.Y);
|
||||
BtnConfirm.Location = new System.Drawing.Point(ScaleSize(60), BtnConfirm.Location.Y);
|
||||
BtnConfirm.Visible = true;
|
||||
BtnConfirm.Enabled = true;
|
||||
}
|
||||
|
||||
public static DialogResult ShowMessage(string message,string confirmText = "确认",string confirmAction = null)
|
||||
public static FormMessage ShowMessage(string message, int closeDelay = 3000)
|
||||
{
|
||||
FormMessage formMessage = new FormMessage();
|
||||
formMessage.SetMessage(message);
|
||||
formMessage.HideConfirm();
|
||||
// 先置顶
|
||||
formMessage.TopMost = true;
|
||||
formMessage.Show();
|
||||
return formMessage;
|
||||
}
|
||||
public static DialogResult ShowMessage(string message, string confirmText = "确认", string confirmAction = null)
|
||||
{
|
||||
FormMessage formMessage = new FormMessage();
|
||||
formMessage.SetMessage(message);
|
||||
formMessage.currentConfirmAction = confirmAction;
|
||||
|
||||
if(string.IsNullOrEmpty(confirmText))
|
||||
if (string.IsNullOrEmpty(confirmText))
|
||||
{
|
||||
formMessage.HideConfirm();
|
||||
}
|
||||
else
|
||||
{
|
||||
formMessage.BtnConfirm.Text = confirmText;
|
||||
formMessage.ResetButtons();
|
||||
}
|
||||
return formMessage.ShowDialog();
|
||||
@ -81,5 +115,21 @@ namespace AIProofread.Controls
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void HanleMouseDown()
|
||||
{
|
||||
ReleaseCapture();
|
||||
SendMessage(this.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
|
||||
}
|
||||
|
||||
private void label1_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
HanleMouseDown();
|
||||
}
|
||||
|
||||
private void panel1_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
HanleMouseDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
46
AIProofread/Controls/MessageTips.Designer.cs
generated
Normal file
@ -0,0 +1,46 @@
|
||||
namespace AIProofread.Controls
|
||||
{
|
||||
partial class MessageTips
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// MessageTips
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(483, 360);
|
||||
this.Name = "MessageTips";
|
||||
this.Text = "MessageTips";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
20
AIProofread/Controls/MessageTips.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AIProofread.Controls
|
||||
{
|
||||
public partial class MessageTips : Form
|
||||
{
|
||||
public MessageTips()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
AIProofread/Controls/MessageTips.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -30,14 +30,18 @@ namespace AIProofread
|
||||
{
|
||||
Directory.CreateDirectory(Config.APP_LOG_PATH);
|
||||
}
|
||||
StreamWriter streamWriter = File.AppendText(path);
|
||||
streamWriter.WriteLine("***************************[" + tag + "]***************************");
|
||||
streamWriter.WriteLine("消息:" + message);
|
||||
streamWriter.WriteLine("时间:" + time);
|
||||
streamWriter.WriteLine();
|
||||
streamWriter.Flush();
|
||||
streamWriter.Close();
|
||||
streamWriter.Dispose();
|
||||
try
|
||||
{
|
||||
StreamWriter streamWriter = File.AppendText(path);
|
||||
streamWriter.WriteLine("***************************[" + tag + "]***************************");
|
||||
streamWriter.WriteLine("消息:" + message);
|
||||
streamWriter.WriteLine("时间:" + time);
|
||||
streamWriter.WriteLine();
|
||||
streamWriter.Flush();
|
||||
streamWriter.Close();
|
||||
streamWriter.Dispose();
|
||||
}
|
||||
catch (Exception e) { }
|
||||
}
|
||||
public static void Log(string msg)
|
||||
{
|
||||
|
@ -80,6 +80,13 @@ namespace AIProofread.Model
|
||||
public CustomTaskPane TaskPane { get; set; }
|
||||
public WdProtectionType ProtectionType { get { return CurrentDocument.ProtectionType; } }
|
||||
|
||||
/// <summary>
|
||||
/// 是否已校对
|
||||
/// </summary>
|
||||
public bool Proofread { get; set; }
|
||||
/// <summary>
|
||||
/// 是否校对中
|
||||
/// </summary>
|
||||
public bool Proofreading { get; set; }
|
||||
|
||||
// 初始化
|
||||
@ -108,6 +115,19 @@ namespace AIProofread.Model
|
||||
FormMessage.ShowMessage(message, confirmText, confirmAction);
|
||||
}));
|
||||
}
|
||||
public void ShowMessage(string message, int closeDelay)
|
||||
{
|
||||
var msgForm = FormMessage.ShowMessage(message, closeDelay);
|
||||
// n毫秒后自动关闭
|
||||
System.Threading.Tasks.Task.Delay(closeDelay).ContinueWith(t =>
|
||||
{
|
||||
if(msgForm.IsDisposed) return;
|
||||
TaskPane.Control.BeginInvoke(new Action(() =>
|
||||
{
|
||||
msgForm.Close();
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public void ShowLogin(string action)
|
||||
{
|
||||
@ -119,11 +139,17 @@ namespace AIProofread.Model
|
||||
}));
|
||||
}
|
||||
|
||||
private void ShowDocumentStatus(string tag)
|
||||
{
|
||||
Logger.Log($"{fileName} {tag} PaneVisible is {PaneVisible} Poofread is {Proofread} Proofreading is {Proofreading}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏面板
|
||||
/// </summary>
|
||||
public void HidePane()
|
||||
{
|
||||
ShowDocumentStatus(" HidePane");
|
||||
if (null != TaskPane) TaskPane.Visible = PaneVisible = false;
|
||||
}
|
||||
|
||||
@ -132,8 +158,9 @@ namespace AIProofread.Model
|
||||
/// </summary>
|
||||
public void Active()
|
||||
{
|
||||
ShowDocumentStatus(" Active");
|
||||
IsActive = true;
|
||||
if (null != TaskPane && PaneVisible)
|
||||
if (Config.IS_WPS && null != TaskPane && PaneVisible)
|
||||
{
|
||||
TaskPane.Visible = true;
|
||||
}
|
||||
@ -141,11 +168,26 @@ namespace AIProofread.Model
|
||||
|
||||
public void Deactive()
|
||||
{
|
||||
ShowDocumentStatus(" Deactive");
|
||||
IsActive = false;
|
||||
if (null != TaskPane && PaneVisible)
|
||||
if (Config.IS_WPS)
|
||||
{
|
||||
TaskPane.Visible = false;
|
||||
if (PaneVisible)
|
||||
{
|
||||
// 异步等待一段时间 重新设置为true,防止面板关闭时,触发事件
|
||||
ThreadPool.QueueUserWorkItem(state =>
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
PaneVisible = true;
|
||||
});
|
||||
}
|
||||
if (null != TaskPane && PaneVisible)
|
||||
{
|
||||
TaskPane.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@ -219,7 +261,7 @@ namespace AIProofread.Model
|
||||
//
|
||||
if (Globals.ThisAddIn.ribbon != null)
|
||||
{
|
||||
Globals.ThisAddIn.ribbon.BtnShowPanel.Enabled = !PaneVisible && marks.Count > 0;
|
||||
Globals.ThisAddIn.ribbon.BtnShowPanel.Enabled = !PaneVisible && Proofread;
|
||||
Globals.ThisAddIn.ribbon.SetCommonBtnStatus(!Proofreading);
|
||||
}
|
||||
}
|
||||
@ -229,6 +271,7 @@ namespace AIProofread.Model
|
||||
// 如果已经隐藏 则记录隐藏用于(WPS)多面板的切换的处理
|
||||
PaneVisible = TaskPane.Visible;
|
||||
CheckBtnStatus();
|
||||
//Globals.ThisAddIn.ribbon.BtnShowPanel.Enabled = !TaskPane.Visible && Proofread;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
@ -548,9 +591,11 @@ namespace AIProofread.Model
|
||||
int prevOffset = 0;
|
||||
|
||||
List<int> disabledList = new List<int>();
|
||||
List<InsertMarkData> insertMarks = new List<InsertMarkData>();
|
||||
foreach (var correct in list)
|
||||
{
|
||||
Logger.Log(string.Format("correct content:", correct.Insert));
|
||||
Logger.Log(string.Format("correct content:{0}", correct.Insert));
|
||||
int currentOffset = correct.SentenceOffset;
|
||||
if (correct.CorrectItems != null && correct.CorrectItems.Count > 0)
|
||||
{
|
||||
prevOffset = 0;
|
||||
@ -565,7 +610,7 @@ namespace AIProofread.Model
|
||||
// 防止调用方法中没有更新
|
||||
if (_prev >= prevOffset)
|
||||
{
|
||||
prevOffset = correct.SentenceOffset + item.Start;
|
||||
prevOffset = currentOffset + item.Start;
|
||||
}
|
||||
|
||||
if (item.Tag != "i") index++;
|
||||
@ -575,23 +620,16 @@ namespace AIProofread.Model
|
||||
try
|
||||
{
|
||||
if (item.Tag == "i")
|
||||
{ // 使用空格填充
|
||||
mark.Text = ToolUtil.GetBlankText(item.Text.Length);
|
||||
}
|
||||
if (item.Color != null)
|
||||
{
|
||||
|
||||
// 颜色转码
|
||||
var color = (WdColor)ColorTranslator.ToOle(Colors.FromHex(Config.TextBackgroundColor));
|
||||
// 给选区添加背景颜色
|
||||
mark.Shading.BackgroundPatternColor = color;
|
||||
//try
|
||||
//{
|
||||
//}
|
||||
//catch (Exception)
|
||||
//{
|
||||
// //item.Value.mark.Shading.BackgroundPatternColor = WdColor.wdColorLightOrange;
|
||||
//}
|
||||
insertMarks.Add(new InsertMarkData()
|
||||
{
|
||||
Mark = mark,
|
||||
InsertLength = item.Text.Length
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMarkStyle(mark);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -614,6 +652,17 @@ namespace AIProofread.Model
|
||||
}
|
||||
}
|
||||
}
|
||||
// 为了避免影响其他文本定位,操作完成后才使用空格填充
|
||||
try
|
||||
{
|
||||
foreach (var item in insertMarks)
|
||||
{
|
||||
item.Mark.Text = ToolUtil.GetBlankText(item.InsertLength);
|
||||
SetMarkStyle(item.Mark);
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
insertMarks.Clear();
|
||||
//foreach (var item in marks)
|
||||
//{
|
||||
// if (item.Value.mark != null)
|
||||
@ -642,6 +691,14 @@ namespace AIProofread.Model
|
||||
MainPanelWebMessage.DisabledProofreadItem(disabledList);
|
||||
}
|
||||
|
||||
private void SetMarkStyle(Microsoft.Office.Tools.Word.Bookmark mark)
|
||||
{
|
||||
// 颜色转码
|
||||
var color = (WdColor)ColorTranslator.ToOle(Colors.FromHex(Config.TextBackgroundColor));
|
||||
// 给选区添加背景颜色
|
||||
mark.Shading.BackgroundPatternColor = color;
|
||||
}
|
||||
|
||||
|
||||
public void InitProofreadCache(List<CorrectContext> list)
|
||||
{
|
||||
@ -759,7 +816,9 @@ namespace AIProofread.Model
|
||||
{
|
||||
try
|
||||
{
|
||||
// 清除标记内存数据
|
||||
marks.Clear();
|
||||
// 清除区域相关数据
|
||||
ranges.Clear();
|
||||
TaskPane.Dispose();
|
||||
}
|
||||
@ -802,7 +861,7 @@ namespace AIProofread.Model
|
||||
{
|
||||
if (!needUpgrade)
|
||||
{
|
||||
ShowDialog("当前版本为最新版本,无需升级","","");
|
||||
ShowDialog("当前版本为最新版本,无需升级", "", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -818,7 +877,7 @@ namespace AIProofread.Model
|
||||
}
|
||||
|
||||
Bridge.bridge.OpenUrlWithOsBrowser(upgradeData.DownloadUrl);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -827,5 +886,32 @@ namespace AIProofread.Model
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void ShowSetting()
|
||||
{
|
||||
|
||||
TaskPane.Control.BeginInvoke(new Action(() =>
|
||||
{
|
||||
FormSetting frm = new FormSetting();
|
||||
frm.Show();
|
||||
}));
|
||||
}
|
||||
public void ShowWebView(string url, int width, int height, bool dialog)
|
||||
{
|
||||
TaskPane.Control.BeginInvoke(new Action(() =>
|
||||
{
|
||||
FormWebView view = new FormWebView(url, width, height);
|
||||
if (dialog)
|
||||
{
|
||||
view.StartPosition = FormStartPosition.CenterScreen;
|
||||
view.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
view.StartPosition = FormStartPosition.CenterParent;
|
||||
view.Show();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,11 +78,11 @@ namespace AIProofread.Model
|
||||
}
|
||||
public bool Remove(Document originDocument)
|
||||
{
|
||||
if(Count > 0 && originDocument != null)
|
||||
if (Count > 0 && originDocument != null)
|
||||
{
|
||||
documentList.RemoveAll(x =>
|
||||
{
|
||||
if(x.CurrentDocument == originDocument)
|
||||
if (x.CurrentDocument == originDocument)
|
||||
{
|
||||
x.Close();
|
||||
return true;
|
||||
|
56
AIProofread/Model/ExportDataItem.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using System.Collections.Generic;
|
||||
using UtilLib;
|
||||
|
||||
namespace AIProofread.Model
|
||||
{
|
||||
public class ExportDataItem
|
||||
{
|
||||
public int PageNumber { get; set; }
|
||||
public int LineNumber { get; set; }
|
||||
public string OriginSentence { get; set; }
|
||||
public CorrectItem Item { get; set; }
|
||||
|
||||
public ExportDataItem(CorrectItem item, int pageNumber, int lineNumber,string originSentence = "")
|
||||
{
|
||||
Item = item;
|
||||
PageNumber = pageNumber;
|
||||
LineNumber = lineNumber;
|
||||
OriginSentence = originSentence;
|
||||
}
|
||||
|
||||
public static List<ExportDataItem> GetExportData(Dictionary<int, ProofreadItem> marks)
|
||||
{
|
||||
List<ExportDataItem> list = new List<ExportDataItem>();
|
||||
|
||||
foreach (var item in marks)
|
||||
{
|
||||
if (item.Value.mark == null) continue;
|
||||
var it = item.Value.content;
|
||||
var range = item.Value.mark.Range;
|
||||
|
||||
// 获取书签在文档的页码数
|
||||
var pageNumber = range.get_Information(WdInformation.wdActiveEndPageNumber);
|
||||
// 获取书签在当前页面的行数
|
||||
var lineNumber = range.get_Information(WdInformation.wdFirstCharacterLineNumber);
|
||||
list.Add(new ExportDataItem(it, pageNumber, lineNumber,item.Value.OriginSentence));
|
||||
}
|
||||
// 根据页码和行数排序
|
||||
list.Sort((x, y) =>
|
||||
{
|
||||
if (x.PageNumber == y.PageNumber)
|
||||
{
|
||||
if(x.LineNumber == y.LineNumber)
|
||||
{
|
||||
// 如果行数相同,则根据起始位置排序
|
||||
return x.Item.Start.CompareTo(y.Item.Start);
|
||||
}
|
||||
// 如果页码相同,则根据行数排序
|
||||
return x.LineNumber.CompareTo(y.LineNumber);
|
||||
}
|
||||
return x.PageNumber.CompareTo(y.PageNumber);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
10
AIProofread/Model/InsertMarkData.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Microsoft.Office.Tools.Word;
|
||||
|
||||
namespace AIProofread.Model
|
||||
{
|
||||
public class InsertMarkData
|
||||
{
|
||||
public Bookmark Mark { get; set; }
|
||||
public int InsertLength { get; set; }
|
||||
}
|
||||
}
|
@ -7,10 +7,10 @@ using System.Security;
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("AI校对王")]
|
||||
[assembly: AssemblyDescription("AI校对王")]
|
||||
[assembly: AssemblyDescription("AI校对王 2.0.3")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("果麦文化")]
|
||||
[assembly: AssemblyProduct("AI校对王")]
|
||||
[assembly: AssemblyProduct("AI校对王 2.0.3")]
|
||||
[assembly: AssemblyCopyright("Copyright © GuoMai 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@ -33,6 +33,6 @@ using System.Security;
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1")]
|
||||
[assembly: AssemblyFileVersion("1.1.0.1")]
|
||||
[assembly: AssemblyVersion("2.0")]
|
||||
[assembly: AssemblyFileVersion("2.0.3.0")]
|
||||
|
||||
|
40
AIProofread/Properties/Resources.Designer.cs
generated
@ -369,5 +369,45 @@ namespace AIProofread.Properties {
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap logo {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("logo", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap logo_no_text {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("logo_no_text", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap logo_no_text_wps {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("logo_no_text_wps", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap logo_wps {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("logo_wps", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,6 +160,9 @@
|
||||
<data name="icon-setting" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-setting.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icon-update" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-update.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@ -181,6 +184,9 @@
|
||||
<data name="icon-export" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icon-history" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-history.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_default" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\button_default.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@ -190,6 +196,9 @@
|
||||
<data name="icon-refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="logo_wps" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\logo_wps.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icon-clear" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-clear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@ -202,13 +211,16 @@
|
||||
<data name="icon-logout" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-logout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icon-history" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-history.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icon_close" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon_close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icon-panel" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon-panel.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icon_close" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icon_close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="logo_no_text" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\logo_no_text.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="logo_no_text_wps" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\logo_no_text_wps.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 942 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
AIProofread/Resources/logo.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
AIProofread/Resources/logo_no_text.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
AIProofread/Resources/logo_no_text_wps.jpg
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
AIProofread/Resources/logo_wps.jpg
Normal file
After Width: | Height: | Size: 4.5 KiB |
90
AIProofread/Ribbon1.Designer.cs
generated
@ -46,15 +46,16 @@ namespace AIProofread
|
||||
this.btnClear = this.Factory.CreateRibbonButton();
|
||||
this.btnOpenLexicon = this.Factory.CreateRibbonButton();
|
||||
this.btnSetting = this.Factory.CreateRibbonButton();
|
||||
this.Group = this.Factory.CreateRibbonGroup();
|
||||
this.ButtonSaveCache = this.Factory.CreateRibbonButton();
|
||||
this.ButtonLoadCache = this.Factory.CreateRibbonButton();
|
||||
this.grpOther = this.Factory.CreateRibbonGroup();
|
||||
this.BtnGetContact = this.Factory.CreateRibbonButton();
|
||||
this.BtnUpdate = this.Factory.CreateRibbonButton();
|
||||
this.btnLogin = this.Factory.CreateRibbonButton();
|
||||
this.btnLogout = this.Factory.CreateRibbonButton();
|
||||
this.LblNickname = this.Factory.CreateRibbonLabel();
|
||||
this.LblDate = this.Factory.CreateRibbonLabel();
|
||||
this.Group = this.Factory.CreateRibbonGroup();
|
||||
this.ButtonSaveCache = this.Factory.CreateRibbonButton();
|
||||
this.ButtonLoadCache = this.Factory.CreateRibbonButton();
|
||||
this.LblNickname = this.Factory.CreateRibbonLabel();
|
||||
this.group2 = this.Factory.CreateRibbonGroup();
|
||||
this.BtnShowPanel = this.Factory.CreateRibbonButton();
|
||||
this.grpDebug = this.Factory.CreateRibbonGroup();
|
||||
@ -70,6 +71,7 @@ namespace AIProofread
|
||||
this.tabAIProofread.SuspendLayout();
|
||||
this.group1.SuspendLayout();
|
||||
this.Group.SuspendLayout();
|
||||
this.grpOther.SuspendLayout();
|
||||
this.group2.SuspendLayout();
|
||||
this.grpDebug.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@ -78,6 +80,7 @@ namespace AIProofread
|
||||
//
|
||||
this.tabAIProofread.Groups.Add(this.group1);
|
||||
this.tabAIProofread.Groups.Add(this.Group);
|
||||
this.tabAIProofread.Groups.Add(this.grpOther);
|
||||
this.tabAIProofread.Groups.Add(this.group2);
|
||||
this.tabAIProofread.Groups.Add(this.grpDebug);
|
||||
this.tabAIProofread.Label = "AI校对王";
|
||||
@ -91,12 +94,6 @@ namespace AIProofread
|
||||
this.group1.Items.Add(this.btnClear);
|
||||
this.group1.Items.Add(this.btnOpenLexicon);
|
||||
this.group1.Items.Add(this.btnSetting);
|
||||
this.group1.Items.Add(this.BtnGetContact);
|
||||
this.group1.Items.Add(this.BtnUpdate);
|
||||
this.group1.Items.Add(this.btnLogin);
|
||||
this.group1.Items.Add(this.btnLogout);
|
||||
this.group1.Items.Add(this.LblNickname);
|
||||
this.group1.Items.Add(this.LblDate);
|
||||
this.group1.Name = "group1";
|
||||
//
|
||||
// BtnProofreadAll
|
||||
@ -139,11 +136,45 @@ namespace AIProofread
|
||||
//
|
||||
this.btnSetting.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||
this.btnSetting.Image = global::AIProofread.Properties.Resources.icon_setting;
|
||||
this.btnSetting.Label = "插件设置\r\n";
|
||||
this.btnSetting.Label = "设置\r\n";
|
||||
this.btnSetting.Name = "btnSetting";
|
||||
this.btnSetting.ShowImage = true;
|
||||
this.btnSetting.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnSetting_Click);
|
||||
//
|
||||
// Group
|
||||
//
|
||||
this.Group.Items.Add(this.ButtonSaveCache);
|
||||
this.Group.Items.Add(this.ButtonLoadCache);
|
||||
this.Group.Name = "Group";
|
||||
//
|
||||
// ButtonSaveCache
|
||||
//
|
||||
this.ButtonSaveCache.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||
this.ButtonSaveCache.Image = global::AIProofread.Properties.Resources.icon_save;
|
||||
this.ButtonSaveCache.Label = "保存进度\r\n";
|
||||
this.ButtonSaveCache.Name = "ButtonSaveCache";
|
||||
this.ButtonSaveCache.ShowImage = true;
|
||||
this.ButtonSaveCache.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ButtonSaveCache_Click);
|
||||
//
|
||||
// ButtonLoadCache
|
||||
//
|
||||
this.ButtonLoadCache.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||
this.ButtonLoadCache.Image = global::AIProofread.Properties.Resources.icon_history;
|
||||
this.ButtonLoadCache.Label = "加载进度\r\n";
|
||||
this.ButtonLoadCache.Name = "ButtonLoadCache";
|
||||
this.ButtonLoadCache.ShowImage = true;
|
||||
this.ButtonLoadCache.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ButtonLoadCache_Click);
|
||||
//
|
||||
// grpOther
|
||||
//
|
||||
this.grpOther.Items.Add(this.BtnGetContact);
|
||||
this.grpOther.Items.Add(this.BtnUpdate);
|
||||
this.grpOther.Items.Add(this.btnLogin);
|
||||
this.grpOther.Items.Add(this.btnLogout);
|
||||
this.grpOther.Items.Add(this.LblDate);
|
||||
this.grpOther.Items.Add(this.LblNickname);
|
||||
this.grpOther.Name = "grpOther";
|
||||
//
|
||||
// BtnGetContact
|
||||
//
|
||||
this.BtnGetContact.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||
@ -181,41 +212,17 @@ namespace AIProofread
|
||||
this.btnLogout.Visible = false;
|
||||
this.btnLogout.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnLogout_Click);
|
||||
//
|
||||
// LblNickname
|
||||
//
|
||||
this.LblNickname.Label = "xxx 已登录";
|
||||
this.LblNickname.Name = "LblNickname";
|
||||
this.LblNickname.Visible = false;
|
||||
//
|
||||
// LblDate
|
||||
//
|
||||
this.LblDate.Label = "过期时间:";
|
||||
this.LblDate.Name = "LblDate";
|
||||
this.LblDate.Visible = false;
|
||||
//
|
||||
// Group
|
||||
// LblNickname
|
||||
//
|
||||
this.Group.Items.Add(this.ButtonSaveCache);
|
||||
this.Group.Items.Add(this.ButtonLoadCache);
|
||||
this.Group.Name = "Group";
|
||||
//
|
||||
// ButtonSaveCache
|
||||
//
|
||||
this.ButtonSaveCache.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||
this.ButtonSaveCache.Image = global::AIProofread.Properties.Resources.icon_save;
|
||||
this.ButtonSaveCache.Label = "暂存文件\r\n";
|
||||
this.ButtonSaveCache.Name = "ButtonSaveCache";
|
||||
this.ButtonSaveCache.ShowImage = true;
|
||||
this.ButtonSaveCache.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ButtonSaveCache_Click);
|
||||
//
|
||||
// ButtonLoadCache
|
||||
//
|
||||
this.ButtonLoadCache.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||
this.ButtonLoadCache.Image = global::AIProofread.Properties.Resources.icon_history;
|
||||
this.ButtonLoadCache.Label = "加载文件\r\n";
|
||||
this.ButtonLoadCache.Name = "ButtonLoadCache";
|
||||
this.ButtonLoadCache.ShowImage = true;
|
||||
this.ButtonLoadCache.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ButtonLoadCache_Click);
|
||||
this.LblNickname.Label = "xxx 已登录";
|
||||
this.LblNickname.Name = "LblNickname";
|
||||
this.LblNickname.Visible = false;
|
||||
//
|
||||
// group2
|
||||
//
|
||||
@ -278,7 +285,7 @@ namespace AIProofread
|
||||
//
|
||||
// BtnTest
|
||||
//
|
||||
this.BtnTest.Label = "打开dialog";
|
||||
this.BtnTest.Label = "获取当前位置";
|
||||
this.BtnTest.Name = "BtnTest";
|
||||
this.BtnTest.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnTest_Click);
|
||||
//
|
||||
@ -317,6 +324,8 @@ namespace AIProofread
|
||||
this.group1.PerformLayout();
|
||||
this.Group.ResumeLayout(false);
|
||||
this.Group.PerformLayout();
|
||||
this.grpOther.ResumeLayout(false);
|
||||
this.grpOther.PerformLayout();
|
||||
this.group2.ResumeLayout(false);
|
||||
this.group2.PerformLayout();
|
||||
this.grpDebug.ResumeLayout(false);
|
||||
@ -355,6 +364,7 @@ namespace AIProofread
|
||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnExportProofreadResult;
|
||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnShowVersion;
|
||||
internal Microsoft.Office.Tools.Ribbon.RibbonDropDown dropDown1;
|
||||
internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpOther;
|
||||
}
|
||||
|
||||
partial class ThisRibbonCollection
|
||||
|
@ -10,6 +10,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using AIProofread.core;
|
||||
using System.Windows.Forms;
|
||||
using AIProofread.Properties;
|
||||
|
||||
namespace AIProofread
|
||||
{
|
||||
@ -75,6 +76,7 @@ namespace AIProofread
|
||||
public void InitWPS()
|
||||
{
|
||||
IS_WPS = true;
|
||||
|
||||
BtnProofreadAll.Image = AIProofread.Properties.Resources.icon_proofread_wps;
|
||||
btnClear.Image = AIProofread.Properties.Resources.icon_clear_wps;
|
||||
btnOpenLexicon.Image = AIProofread.Properties.Resources.icon_book_wps;
|
||||
@ -186,12 +188,13 @@ namespace AIProofread
|
||||
private void btnClear_Click(object sender, RibbonControlEventArgs e)
|
||||
{
|
||||
//DocumentUtil.ClearProofreadMarks();
|
||||
var result = MessageBox.Show("请确认是否清除此文档的所有校对标注?", "提示", MessageBoxButtons.OKCancel);
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
//Bridge.bridge.clearAllProofreadMark(null);
|
||||
Globals.ThisAddIn.ClearAllProofreadMark();
|
||||
}
|
||||
|
||||
Globals.ThisAddIn.ActiveDocument.ShowDialog("请确认是否清除此文档的所有校对标注?", "确定", "clear-tips");
|
||||
//if (result == DialogResult.OK)
|
||||
//{
|
||||
// //Bridge.bridge.clearAllProofreadMark(null);
|
||||
// Globals.ThisAddIn.ClearAllProofreadMark();
|
||||
//}
|
||||
}
|
||||
|
||||
private void btnShowPane_Click(object sender, RibbonControlEventArgs e)
|
||||
@ -473,8 +476,39 @@ namespace AIProofread
|
||||
// 获取当前系统时间戳
|
||||
//int time = (int)(DateTime.Now.Ticks / 10000000);
|
||||
//BtnTest.Label = "测试按钮" + time;
|
||||
var result = MessageBox.Show("Test", "xxx");
|
||||
//var result = MessageBox.Show("Test", "xxx");
|
||||
//Globals.ThisAddIn.Application.
|
||||
var app = Globals.ThisAddIn.Application;
|
||||
var selection = app.Selection;
|
||||
var range = selection.Range;
|
||||
// 获取所在页
|
||||
var pageNumber = GetIndexPageNumber(range);
|
||||
// 获取所在行
|
||||
var rowNumber = range.get_Information(WdInformation.wdFirstCharacterLineNumber);
|
||||
|
||||
int paragraphNumber = 0;
|
||||
if (range.Paragraphs.Count > 0)
|
||||
{
|
||||
// 获取当前文本在文档的段落数
|
||||
var currentParagraph = range.Paragraphs.First;
|
||||
var currentParagraphStart = currentParagraph.Range.Start;
|
||||
var allParagraphs = app.ActiveDocument.Paragraphs;
|
||||
for (var i = 1; i <= allParagraphs.Count; i++)
|
||||
{
|
||||
var paragraph = allParagraphs[i];
|
||||
var paragraphStart = paragraph.Range.Start;
|
||||
if (paragraphStart > currentParagraphStart)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (currentParagraphStart == paragraphStart || paragraph == currentParagraph)
|
||||
{
|
||||
paragraphNumber = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
MessageBox.Show($"当前页:{pageNumber}, 行:{rowNumber}, 段落:{paragraphNumber}");
|
||||
}
|
||||
|
||||
private void ButtonSaveCache_Click(object sender, RibbonControlEventArgs e)
|
||||
@ -484,7 +518,7 @@ namespace AIProofread
|
||||
|
||||
private void ButtonLoadCache_Click(object sender, RibbonControlEventArgs e)
|
||||
{
|
||||
Globals.ThisAddIn.SendMessageToWeb("load-cache", "");
|
||||
Globals.ThisAddIn.ShowDialog("即将加载最近保存的进度,新的修改可能会丢失!", "确定", "load-cache");
|
||||
}
|
||||
|
||||
private void BtnShowPanel_Click(object sender, RibbonControlEventArgs e)
|
||||
|
@ -61,6 +61,8 @@ namespace AIProofread
|
||||
public bool IsWPS { get; set; }
|
||||
|
||||
public List<FormLogin> LoginFormList = new List<FormLogin>();
|
||||
public static bool AppRunning = true;
|
||||
private System.Timers.Timer _timer;
|
||||
|
||||
//public override void BeginInit()
|
||||
//{
|
||||
@ -69,12 +71,25 @@ namespace AIProofread
|
||||
// CurrentWordApplication.DocumentChange += CurrentWordApplication_DocumentChange;
|
||||
//}
|
||||
|
||||
private void ProcessApplicationException(object sender,UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Logger.Log("UnhandledException",e.ExceptionObject as Exception);
|
||||
}
|
||||
|
||||
private void ProcessApplicationFormException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
{
|
||||
Logger.Log("ProcessApplicationFormException", e.Exception);
|
||||
}
|
||||
|
||||
private void ThisAddIn_Startup(object sender, System.EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
AppInitialize();
|
||||
Logger.Log("ThisAddIn_Startup IS_WPS --> " + IsWPS);
|
||||
// 捕获全局异常
|
||||
AppDomain.CurrentDomain.UnhandledException += ProcessApplicationException;
|
||||
System.Windows.Forms.Application.ThreadException += ProcessApplicationFormException;
|
||||
|
||||
// 处理文档事件
|
||||
Application.DocumentOpen += Application_DocumentOpen;
|
||||
@ -89,12 +104,60 @@ namespace AIProofread
|
||||
// 选区发生变化事件
|
||||
this.Application.WindowSelectionChange += Application_WindowSelectionChange;
|
||||
//CheckPluginUpgradeInfo();
|
||||
// CheckDocumentClosedTick();
|
||||
|
||||
// 定时检测文档是否关闭
|
||||
_timer = new System.Timers.Timer(10000);
|
||||
_timer.Elapsed += CheckDocumentClosed;
|
||||
_timer.AutoReset = true;
|
||||
_timer.Enabled = true;
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
Logger.Log("Startup", ex1.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void CheckDocumentClosed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var existsList = new List<string>();
|
||||
Logger.Log("检测文档是否关闭 ...");
|
||||
try
|
||||
{
|
||||
if (documentList.Count == 0 || CurrentWordApplication.Documents.Count == documentList.Count) return;
|
||||
|
||||
existsList.Clear();
|
||||
|
||||
foreach (Document item in CurrentWordApplication.Documents)
|
||||
{
|
||||
existsList.Add(item.FullName);
|
||||
}
|
||||
// 检测文档是否关闭
|
||||
foreach (var item in documentList.documentList)
|
||||
{
|
||||
if (!existsList.Contains(item.fileName))
|
||||
{
|
||||
Logger.Log("检测到文档关闭,已移除:" + item.fileName);
|
||||
documentList.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log(ex);
|
||||
}
|
||||
//await System.Threading.Tasks.Task.Run(() =>
|
||||
// {
|
||||
//
|
||||
// while (AppRunning)
|
||||
// {
|
||||
// Thread.Sleep(10000); // 暂停10s
|
||||
|
||||
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
async void CheckPluginUpgradeInfo()
|
||||
{
|
||||
@ -152,6 +215,15 @@ namespace AIProofread
|
||||
Logger.Log("Init WPS Error " + ex.Message);
|
||||
}
|
||||
}
|
||||
string verTextFile = Config.APP_BASE_DIR + Path.GetFileName("app_version.txt");
|
||||
try
|
||||
{
|
||||
File.WriteAllText(verTextFile, Config.APP_VERSION);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log("Write App Version Error " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitAppByConfig()
|
||||
@ -257,7 +329,6 @@ namespace AIProofread
|
||||
private void Application_DocumentBeforeClose(Document currentDoc, ref bool Cancel)
|
||||
{
|
||||
Logger.Log("DocumentBeforeClose", currentDoc.FullName);
|
||||
documentList.Remove(currentDoc);
|
||||
//if (allMarks.ContainsKey(currentDoc))
|
||||
//{
|
||||
// allMarks.Remove(currentDoc);
|
||||
@ -403,8 +474,15 @@ namespace AIProofread
|
||||
{
|
||||
// PanelModule.DisposeCTP();
|
||||
//this.proofreadPanel.Dispose();
|
||||
// 取消捕获全局异常事件
|
||||
AppDomain.CurrentDomain.UnhandledException -= ProcessApplicationException;
|
||||
System.Windows.Forms.Application.ThreadException -= ProcessApplicationFormException;
|
||||
Logger.Log("shutdown");
|
||||
documentList.Clear();
|
||||
if(_timer != null)
|
||||
{
|
||||
_timer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public void SyncLogout()
|
||||
@ -443,12 +521,21 @@ namespace AIProofread
|
||||
public void ClearAllProofreadMark()
|
||||
{
|
||||
ActiveDocument?.ClearAllProofreadMark();
|
||||
Globals.ThisAddIn.SendMessageToWeb("clear-tips", null);
|
||||
//Globals.ThisAddIn.SendMessageToWeb("clear-tips", null);
|
||||
}
|
||||
|
||||
public void ShowDialog(string message, string confirmText, string confirmAction)
|
||||
{
|
||||
ActiveDocument?.ShowDialog(message, confirmText, confirmAction);
|
||||
}
|
||||
public void ShowMessage(string message, int closeDelay)
|
||||
{
|
||||
ActiveDocument?.ShowMessage(message, closeDelay);
|
||||
}
|
||||
|
||||
|
||||
//public string LoadCacheByPath()
|
||||
//{
|
||||
//public string LoadCacheByPath()
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
@ -464,7 +551,7 @@ namespace AIProofread
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InternalStartup()
|
||||
private void InternalStartup()
|
||||
{
|
||||
this.Startup += new System.EventHandler(ThisAddIn_Startup);
|
||||
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
|
||||
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AIProofread.Util
|
||||
{
|
||||
@ -28,5 +29,35 @@ namespace AIProofread.Util
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
|
||||
#region 获取系统屏幕缩放比例
|
||||
public const int HORZRES = 8;
|
||||
public const int VERTRES = 10;
|
||||
public const int LOGPIXELSX = 88;
|
||||
public const int LOGPIXELSY = 90;
|
||||
public const int DESKTOPVERTRES = 117;
|
||||
public const int DESKTOPHORZRES = 118;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr GetDC(IntPtr ptr);
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern int GetDeviceCaps(
|
||||
IntPtr hdc, // handle to DC
|
||||
int nIndex // index of capability
|
||||
);
|
||||
[DllImport("user32.dll", EntryPoint = "ReleaseDC")]
|
||||
public static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr GetDesktopWindow();
|
||||
|
||||
public static float GetSreenScale()
|
||||
{
|
||||
var hdc = GetDC(GetDesktopWindow());
|
||||
int nWidth = GetDeviceCaps(hdc, DESKTOPHORZRES);
|
||||
ReleaseDC(IntPtr.Zero, hdc);
|
||||
float f_Scale = (float)nWidth / (float)Screen.PrimaryScreen.Bounds.Width;
|
||||
return 1 / f_Scale;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,11 @@ using NPOI.XSSF.UserModel;
|
||||
using System.Windows.Forms;
|
||||
using NPOI.SS.UserModel;
|
||||
using System.IO;
|
||||
using SixLabors.Fonts.Tables.AdvancedTypographic;
|
||||
using MathNet.Numerics.LinearAlgebra.Factorization;
|
||||
using System.Linq;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using AIProofread.Model;
|
||||
|
||||
namespace AIProofread
|
||||
{
|
||||
@ -318,7 +323,7 @@ namespace AIProofread
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log(ex);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
//if(bookmark == null)
|
||||
@ -376,8 +381,42 @@ namespace AIProofread
|
||||
return bookmark;
|
||||
}
|
||||
|
||||
private static Range FindBySentence(Range paraRange, CorrectContext c, CorrectItem item, Microsoft.Office.Interop.Word.Document document)
|
||||
{
|
||||
try
|
||||
{
|
||||
var allSentenceCount = paraRange.Sentences.Count;
|
||||
if (allSentenceCount < c.SentenceNumber) return null;
|
||||
var sentence = paraRange.Sentences[c.SentenceNumber]; //paraText.Substring(c.SentenceOffset, c.InsertLength);
|
||||
c.SentenceOffset = sentence.Start;
|
||||
var offset = c.SentenceOffset;
|
||||
|
||||
if (c.Insert == sentence.Text)
|
||||
{
|
||||
if (item.Tag == "i")
|
||||
{
|
||||
return document.Range(offset + item.Start, offset + item.Start);
|
||||
}
|
||||
// 比对原始内容与校对原文是否一致
|
||||
var range = document.Range(offset + item.Start, offset + item.End + 1);
|
||||
//
|
||||
if (range.Text == item.Origin)
|
||||
{
|
||||
return range;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Range FindRangeByCorrect(CorrectContext c, CorrectItem item, Paragraph paragraph, Microsoft.Office.Interop.Word.Document document, int prevOffset)
|
||||
{
|
||||
|
||||
var originText = c.Insert;
|
||||
var paraRange = paragraph.Range;
|
||||
var paraText = paraRange.Text;
|
||||
var paraStart = paraRange.Start;
|
||||
@ -385,25 +424,10 @@ namespace AIProofread
|
||||
// 定位句子的其实位置
|
||||
//var offset = paraStart + c.SentenceOffset;
|
||||
////var cutLength = Math.Min(c.InsertLen, paraText.Length - offset);
|
||||
/// TODO 目前接口没有返回 句子相关数据 直接获取
|
||||
var sentence = paraRange.Sentences[c.SentenceNumber]; //paraText.Substring(c.SentenceOffset, c.InsertLength);
|
||||
c.SentenceOffset = sentence.Start;
|
||||
var offset = c.SentenceOffset;
|
||||
c.Insert = sentence.Text;
|
||||
|
||||
if (sentence.Text == c.Insert)
|
||||
{
|
||||
if (item.Tag == "i")
|
||||
{
|
||||
return document.Range(offset + item.Start, offset + item.Start);
|
||||
}
|
||||
// 比对原始内容与校对原文是否一致
|
||||
var range = document.Range(offset + item.Start, offset + item.End + 1);
|
||||
//
|
||||
if (range.Text == item.Origin) return range;
|
||||
}
|
||||
var originFindRange = FindBySentence(paraRange, c, item, document);
|
||||
if (originFindRange != null) return originFindRange;
|
||||
|
||||
var originText = c.Insert;
|
||||
// 如果是新增 则查找定位
|
||||
if (item.Tag == "i")
|
||||
{
|
||||
@ -426,10 +450,16 @@ namespace AIProofread
|
||||
if (start1 != -1)
|
||||
{
|
||||
var findOffset = paraStart + start1 + (prefix1 != null ? prefix1.Length : 0);
|
||||
return document.Range(findOffset, findOffset + 1);
|
||||
return document.Range(findOffset, findOffset);
|
||||
}
|
||||
}
|
||||
|
||||
if (prevOffset >= paraText.Length)
|
||||
{
|
||||
// 查找位置已经超过了整段长度了
|
||||
Logger.Log("prevOffset:" + prevOffset + " paraText.Length:" + paraText.Length);
|
||||
return null;
|
||||
}
|
||||
// 执行查找
|
||||
int wordStart = item.Start;
|
||||
int wordEnd = item.End;
|
||||
@ -447,6 +477,7 @@ namespace AIProofread
|
||||
? originText.Substring(wordStart, INSERT_FIND_OFFSET)
|
||||
: originText.Substring(wordStart, originText.Length - wordStart)
|
||||
) : null;
|
||||
|
||||
var start = prefix != null || suffix != null
|
||||
? paraText.IndexOf(prefix ?? suffix, prevOffset) // item.start +
|
||||
: -1;
|
||||
@ -467,7 +498,12 @@ namespace AIProofread
|
||||
|
||||
public static void ExportProofreadResult()
|
||||
{
|
||||
string currentName = Globals.ThisAddIn.Application.ActiveDocument.Name;
|
||||
// 去掉文件名后缀
|
||||
currentName = currentName.Substring(0, currentName.LastIndexOf("."));
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
// 设置默认文件名
|
||||
sfd.FileName = currentName + "_勘误表.xlsx";
|
||||
sfd.Filter = "Excel文件|*.xlsx";
|
||||
var result = sfd.ShowDialog();
|
||||
// 如果用户取消选择,则返回
|
||||
@ -475,18 +511,63 @@ namespace AIProofread
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (var fs = File.OpenWrite(sfd.FileName))
|
||||
try
|
||||
{
|
||||
if (File.Exists(sfd.FileName))
|
||||
{
|
||||
// 判断原始文件是否可以删除
|
||||
if (File.GetAttributes(sfd.FileName).HasFlag(FileAttributes.ReadOnly))
|
||||
{
|
||||
Globals.ThisAddIn.ShowDialog("已经存在名勘误表文件,请更换名称或者手动删除", null, null);
|
||||
return;
|
||||
}
|
||||
// 删除文件 重新写入新数据避免出现未知不可控bug
|
||||
File.Delete(sfd.FileName);
|
||||
}
|
||||
ProcessExport(sfd.FileName);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Globals.ThisAddIn.ShowDialog("导出勘误表失败", null, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static NPOI.SS.UserModel.ICell CreateCell(IRow row, int colIndex, IFont font, string text)
|
||||
{
|
||||
var cell = row.CreateCell(colIndex);
|
||||
if (font != null)
|
||||
{
|
||||
var value = new XSSFRichTextString(text);
|
||||
value.ApplyFont(font);
|
||||
cell.SetCellValue(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
cell.SetCellValue(text);
|
||||
}
|
||||
cell.CellStyle.WrapText = true;
|
||||
return cell;
|
||||
}
|
||||
|
||||
private static void ProcessExport(string fileName)
|
||||
{
|
||||
using (var fs = File.Create(fileName))
|
||||
{
|
||||
var book = new XSSFWorkbook();
|
||||
var sheet = book.CreateSheet("Sheet1");
|
||||
var simHeiFont = CreateBaseFont(book, "黑体", 11);
|
||||
simHeiFont.Color = NPOI.HSSF.Util.HSSFColor.Black.Index;
|
||||
// 设置表格样式
|
||||
var style = CreateBaseCellStyle(book);
|
||||
style.SetFont(CreateBaseFont(book));
|
||||
/* 系统与正文用不同字体区分(包括顶部栏、处理列、新增、删除等提示)勘误表系统字体为黑体,所有字号统一 */
|
||||
style.SetFont(simHeiFont);
|
||||
style.BorderBottom = NPOI.SS.UserModel.BorderStyle.None;
|
||||
style.BorderTop = NPOI.SS.UserModel.BorderStyle.None;
|
||||
style.BorderLeft = NPOI.SS.UserModel.BorderStyle.None;
|
||||
style.BorderRight = NPOI.SS.UserModel.BorderStyle.None;
|
||||
style.WrapText = true;
|
||||
|
||||
sheet.SetDefaultColumnStyle(0, style);
|
||||
sheet.SetDefaultColumnStyle(1, style);
|
||||
sheet.SetDefaultColumnStyle(2, style);
|
||||
@ -498,89 +579,191 @@ namespace AIProofread
|
||||
|
||||
// 表头设置
|
||||
var row = sheet.CreateRow(0);
|
||||
row.CreateCell(0).SetCellValue("序号");
|
||||
row.CreateCell(1).SetCellValue("页");
|
||||
row.CreateCell(2).SetCellValue("行");
|
||||
CreateCell(row, 0, simHeiFont, "序号");
|
||||
CreateCell(row, 1, simHeiFont, "页");
|
||||
CreateCell(row, 2, simHeiFont, "行");
|
||||
CreateCell(row, 3, simHeiFont, "详细信息");
|
||||
CreateCell(row, 4, simHeiFont, "异常");
|
||||
CreateCell(row, 5, simHeiFont, "建议");
|
||||
CreateCell(row, 6, simHeiFont, "处理状态");
|
||||
|
||||
var cell = row.CreateCell(3);//
|
||||
// 设置宽度
|
||||
sheet.SetColumnWidth(3, 50 * 256);
|
||||
cell.SetCellValue("详细信息");
|
||||
sheet.SetColumnWidth(3, 80 * 256); // 详细信息
|
||||
sheet.SetColumnWidth(4, 15 * 256); // 异常
|
||||
sheet.SetColumnWidth(5, 15 * 256); // 建议
|
||||
sheet.SetColumnWidth(6, 8 * 256); // 建议
|
||||
|
||||
var cellExp = row.CreateCell(4);
|
||||
// 设置文字颜色为红色
|
||||
var expStyle = book.CreateCellStyle();
|
||||
var f1 = CreateBaseFont(book);
|
||||
f1.Color = NPOI.HSSF.Util.HSSFColor.Red.Index;
|
||||
expStyle.SetFont(f1);
|
||||
cellExp.CellStyle = expStyle;
|
||||
cellExp.SetCellValue("异常");
|
||||
var blackFont = CreateBaseFont(book, NPOI.HSSF.Util.HSSFColor.Black.Index);
|
||||
|
||||
var suggestCell = row.CreateCell(5);//
|
||||
suggestCell.CellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.Red.Index;
|
||||
suggestCell.SetCellValue("建议");
|
||||
|
||||
row.CreateCell(6).SetCellValue("处理状态");
|
||||
|
||||
var blackFont = CreateBaseFont(book);
|
||||
blackFont.Color = NPOI.HSSF.Util.HSSFColor.Black.Index;
|
||||
var redFont = CreateBaseFont(book);
|
||||
redFont.Color = NPOI.HSSF.Util.HSSFColor.Red.Index;
|
||||
var redFont = CreateBaseFont(book, NPOI.HSSF.Util.HSSFColor.Red.Index);
|
||||
|
||||
// 获取排序后的数据
|
||||
var list = ExportDataItem.GetExportData(Globals.ThisAddIn.ActiveDocument.marks);
|
||||
// 对 list 进行排序
|
||||
int id = 1;
|
||||
foreach (var item in Globals.ThisAddIn.ActiveDocument.marks)
|
||||
|
||||
var wrapTextStyle = book.CreateCellStyle();
|
||||
wrapTextStyle.WrapText = true;
|
||||
wrapTextStyle.VerticalAlignment = VerticalAlignment.Center;
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item.Value.mark == null) continue;
|
||||
var it = item.Value.content;
|
||||
var range = item.Value.mark.Range;
|
||||
try
|
||||
{
|
||||
var it = item.Item;
|
||||
row = sheet.CreateRow(id);
|
||||
row.Height = -1;
|
||||
row.CreateCell(0).SetCellValue(id);
|
||||
row.CreateCell(1).SetCellValue(item.PageNumber);
|
||||
row.CreateCell(2).SetCellValue(item.LineNumber);
|
||||
|
||||
// 获取书签在文档的页码数
|
||||
var pageNumber = range.get_Information(WdInformation.wdActiveEndPageNumber);
|
||||
// 获取书签在当前页面的行数
|
||||
var lineNumber = range.get_Information(WdInformation.wdFirstCharacterLineNumber);
|
||||
row = sheet.CreateRow(id);
|
||||
row.CreateCell(0).SetCellValue(id);
|
||||
row.CreateCell(1).SetCellValue(pageNumber);
|
||||
row.CreateCell(2).SetCellValue(lineNumber);
|
||||
#region 引用原文内容
|
||||
string originSentence = item.OriginSentence;
|
||||
if (it.Tag == "i")
|
||||
{
|
||||
// ˽
|
||||
// 对查找内容引用红色
|
||||
try
|
||||
{
|
||||
originSentence = originSentence.Substring(0, it.Start) + GetInsertContentByLength(it.Text.Length) + originSentence.Substring(it.Start);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log(e);
|
||||
}
|
||||
}
|
||||
|
||||
XSSFRichTextString originText = new XSSFRichTextString(item.Value.OriginSentence);
|
||||
originText.ApplyFont(blackFont);
|
||||
var startIndex = item.Value.OriginSentence.IndexOf(it.Origin);
|
||||
// 对查找内容引用红色
|
||||
originText.ApplyFont(startIndex, startIndex + it.Origin.Length, redFont);
|
||||
row.CreateCell(3).SetCellValue(originText);
|
||||
XSSFRichTextString originText = new XSSFRichTextString(originSentence.TrimEnd());
|
||||
originText.ApplyFont(blackFont);
|
||||
var startIndex = it.Tag == "i" ? it.Start : originSentence.IndexOf(it.Origin);
|
||||
// 对查找内容引用红色
|
||||
originText.ApplyFont(it.Start, it.Start + (it.Tag == "i" ? it.Text.Length : it.Origin.Length), redFont);
|
||||
var oriCell = row.CreateCell(3);
|
||||
// 设置单元格内容自动换行
|
||||
oriCell.CellStyle = wrapTextStyle;
|
||||
oriCell.SetCellValue(originText);
|
||||
#endregion
|
||||
|
||||
row.CreateCell(4).SetCellValue(it.Origin);
|
||||
if(it.Tag == "r") {
|
||||
// 原始内容
|
||||
|
||||
var cellOrigin = row.CreateCell(4);
|
||||
cellOrigin.CellStyle = wrapTextStyle;
|
||||
cellOrigin.SetCellValue(it.Origin);
|
||||
|
||||
#region 建议
|
||||
var suggest = it.Text;
|
||||
if(it.Type == "sensitive")
|
||||
|
||||
var cellSuggest = row.CreateCell(5);
|
||||
cellSuggest.CellStyle = wrapTextStyle;
|
||||
if (it.Tag == "r")
|
||||
{
|
||||
suggest += "(敏感词)";
|
||||
string tag = "";
|
||||
if (it.Type == "blacklist")
|
||||
{
|
||||
tag = "黑名单";
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO 后期优化
|
||||
// 易错词 标点 不标识
|
||||
if (it.Type == "confusion" || it.Type == "model" || it.Type == "other" || it.Type == "punctuation")
|
||||
{
|
||||
//row.CreateCell(5).SetCellValue(suggest);
|
||||
}
|
||||
else if (it.Type == "first_choice")
|
||||
{
|
||||
|
||||
tag = "【提示】首选";
|
||||
//row.CreateCell(5).SetCellValue(suggest + " 【提示】首选");
|
||||
}
|
||||
else if (it.Type == "now_called")
|
||||
{
|
||||
tag = "【提示】现称";
|
||||
//row.CreateCell(5).SetCellValue(suggest + " 【提示】现称");
|
||||
}
|
||||
else if (it.Type == "quoting_legal")
|
||||
{
|
||||
tag = "【提示】法规";
|
||||
//row.CreateCell(5).SetCellValue(suggest + " 【提示】法规");
|
||||
}
|
||||
else if (it.Type == "incorrect_expression")
|
||||
{
|
||||
tag = "【提示】表述有误";
|
||||
//row.CreateCell(5).SetCellValue(suggest + " 【提示】表述有误");
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(it.Addition) && it.Addition.Trim().Length > 0 && it.Addition != "提示")
|
||||
{
|
||||
//row.CreateCell(5).SetCellValue(suggest + (string.IsNullOrEmpty(it.Addition) ? "" : $" 【提示】{it.Addition}"));
|
||||
tag = $"【提示】{it.Addition}";
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrEmpty(tag))
|
||||
{
|
||||
cellSuggest.SetCellValue(suggest);
|
||||
}
|
||||
else
|
||||
{
|
||||
XSSFRichTextString replaceText = new XSSFRichTextString(suggest + $" {tag}");
|
||||
replaceText.ApplyFont(blackFont);
|
||||
// 对查找内容引用红色
|
||||
replaceText.ApplyFont(suggest.Length + 1, suggest.Length + 1 + tag.Length, simHeiFont);
|
||||
cellSuggest.SetCellValue(replaceText);
|
||||
}
|
||||
|
||||
}
|
||||
else if (it.Type == "blacklist")
|
||||
else
|
||||
{
|
||||
suggest += "(敏感词)";
|
||||
string tag = "";
|
||||
startIndex = 0;
|
||||
if (it.Type == "incorrect_expression")
|
||||
{
|
||||
tag = "表述有误";
|
||||
}
|
||||
else if (it.Type == "sensitive")
|
||||
{
|
||||
tag = "敏感词";
|
||||
}
|
||||
else if (it.Type == "blacklist")
|
||||
{
|
||||
tag = "黑名单";
|
||||
}
|
||||
else if (it.Tag == "i")
|
||||
{
|
||||
startIndex = it.Text.Length + 1;
|
||||
tag = it.Text + " 新增";
|
||||
}
|
||||
else if (it.Tag == "d")
|
||||
{
|
||||
tag = "删除";
|
||||
}
|
||||
XSSFRichTextString suggestText = new XSSFRichTextString(tag);
|
||||
suggestText.ApplyFont(blackFont);
|
||||
if (tag.Length > 0)
|
||||
{
|
||||
// 对查找内容引用红色
|
||||
suggestText.ApplyFont(startIndex, it.Tag == "i" ? startIndex + 2 : tag.Length, simHeiFont);
|
||||
cellSuggest.SetCellValue(suggestText);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellSuggest.SetCellValue(suggest);
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(it.Addition))
|
||||
{
|
||||
suggest += $"({it.Addition})";
|
||||
}
|
||||
row.CreateCell(5).SetCellValue(suggest);
|
||||
#endregion
|
||||
// 处理状态
|
||||
var statusValue = new XSSFRichTextString(StatusText(it.IsAccept));
|
||||
statusValue.ApplyFont(simHeiFont);
|
||||
row.CreateCell(6).SetCellValue(statusValue);
|
||||
}
|
||||
else if(it.Tag == "i")
|
||||
catch (Exception ex)
|
||||
{
|
||||
row.CreateCell(5).SetCellValue("新增");
|
||||
Logger.Log(ex);
|
||||
}
|
||||
else if (it.Tag == "e")
|
||||
{
|
||||
row.CreateCell(5).SetCellValue("删除");
|
||||
}
|
||||
row.CreateCell(6).SetCellValue(StatusText(it.IsAccept));
|
||||
id++;
|
||||
}
|
||||
|
||||
// 保存到文件
|
||||
book.Write(fs);
|
||||
Globals.ThisAddIn.ShowMessage("导出成功", 3000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -594,23 +777,38 @@ namespace AIProofread
|
||||
|
||||
return style;
|
||||
}
|
||||
private static IFont CreateBaseFont(IWorkbook workbook)
|
||||
private static IFont CreateBaseFont(IWorkbook workbook, string name, int size)
|
||||
{
|
||||
// 宋体 11
|
||||
var font = workbook.CreateFont();
|
||||
font.FontName = "宋体";
|
||||
font.FontHeightInPoints = 11;
|
||||
font.FontName = name;
|
||||
font.FontHeightInPoints = size;
|
||||
|
||||
return font;
|
||||
}
|
||||
private static IFont CreateBaseFont(IWorkbook workbook, short color = -1)
|
||||
{
|
||||
var font = CreateBaseFont(workbook, "宋体", 11);
|
||||
if (color != -1)
|
||||
{
|
||||
font.Color = color;
|
||||
}
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
private static string StatusText(int status)
|
||||
{
|
||||
if (status == AcceptStatus.Accept) return "采纳";
|
||||
else if (status == AcceptStatus.Review) return "复核";
|
||||
else if (status == AcceptStatus.Ignore) return "忽略";
|
||||
if (status == AcceptStatus.Accept) return "已采纳";
|
||||
else if (status == AcceptStatus.Review) return "已复核";
|
||||
else if (status == AcceptStatus.Ignore) return "已忽略";
|
||||
|
||||
return "未处理";
|
||||
}
|
||||
|
||||
private static string GetInsertContentByLength(int length)
|
||||
{
|
||||
return new String('˽', length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
73697d8cfbb569cc987afc71aa3dff1fa36374eacaf0a7c7b55871ef5023996c
|
||||
54a319e61bbb40f00beb0f42abcb8716c81b74e48883b7a20bcbaff71f4ef2ff
|
||||
|
@ -194,10 +194,15 @@ C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\System.Text.
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\System.Threading.Tasks.Extensions.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.csproj.AssemblyReference.cache
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormContact.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormDialog.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormLoading.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormLogger.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormLogin.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormMain.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormMask.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormMessage.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormSetting.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormWebView.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.ProofreadMainControl.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Properties.Resources.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Ribbon1.resources
|
||||
@ -206,8 +211,4 @@ C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofr.8811D769.Up2Date
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormLogger.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormMessage.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormDialog.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormWebView.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormMask.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.MessageTips.resources
|
||||
|
BIN
AIProofread/obj/Test/AIProofread.Controls.FormContact.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormDialog.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormLoading.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormLogger.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormLogin.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormMain.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormMask.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormMessage.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormSetting.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.FormWebView.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Controls.MessageTips.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Properties.Resources.resources
Normal file
BIN
AIProofread/obj/Test/AIProofread.Ribbon1.resources
Normal file
@ -0,0 +1 @@
|
||||
4265708d7b55b9c01ee442ddd67da2cc9ebd4051ae43c8ac32f7af287abf1440
|
190
AIProofread/obj/Test/AIProofread.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,190 @@
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\runtimes\win-x86\native\WebView2Loader.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\runtimes\win-x64\native\WebView2Loader.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\runtimes\win-arm64\native\WebView2Loader.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\AIProofread.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\AIProofread.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\AIProofread.dll.manifest
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\AIProofread.vsto
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.InteropServices.RuntimeInformation.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Win32.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\netstandard.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.AppContext.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Collections.Concurrent.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Collections.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Collections.NonGeneric.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Collections.Specialized.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.ComponentModel.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.ComponentModel.EventBasedAsync.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.ComponentModel.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.ComponentModel.TypeConverter.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Console.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Data.Common.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.Contracts.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.Debug.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.FileVersionInfo.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.Process.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.StackTrace.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.TextWriterTraceListener.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.Tools.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.TraceSource.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Diagnostics.Tracing.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Drawing.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Dynamic.Runtime.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Globalization.Calendars.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Globalization.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Globalization.Extensions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.Compression.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.Compression.ZipFile.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.FileSystem.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.FileSystem.DriveInfo.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.FileSystem.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.FileSystem.Watcher.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.IsolatedStorage.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.MemoryMappedFiles.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.Pipes.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.IO.UnmanagedMemoryStream.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Linq.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Linq.Expressions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Linq.Parallel.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Linq.Queryable.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.Http.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.NameResolution.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.NetworkInformation.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.Ping.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.Requests.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.Security.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.Sockets.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.WebHeaderCollection.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.WebSockets.Client.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Net.WebSockets.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.ObjectModel.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Reflection.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Reflection.Extensions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Reflection.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Resources.Reader.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Resources.ResourceManager.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Resources.Writer.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.CompilerServices.VisualC.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Extensions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Handles.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.InteropServices.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Numerics.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Serialization.Formatters.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Serialization.Json.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Serialization.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.Serialization.Xml.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Claims.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Algorithms.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Csp.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Encoding.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Primitives.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.X509Certificates.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Principal.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.SecureString.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Text.Encoding.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Text.Encoding.Extensions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Text.RegularExpressions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Overlapped.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Tasks.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Tasks.Parallel.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Thread.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.ThreadPool.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Timer.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.ValueTuple.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Xml.ReaderWriter.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Xml.XDocument.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Xml.XmlDocument.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Xml.XmlSerializer.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Xml.XPath.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Xml.XPath.XDocument.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\BouncyCastle.Cryptography.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Enums.NET.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\ExtendedNumerics.BigDecimal.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\ICSharpCode.SharpZipLib.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\MathNet.Numerics.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.IO.RecyclableMemoryStream.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Office.Tools.Common.v4.0.Utilities.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Web.WebView2.Core.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Web.WebView2.WinForms.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Web.WebView2.Wpf.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Newtonsoft.Json.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.Core.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OOXML.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OpenXml4Net.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OpenXmlFormats.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\SixLabors.Fonts.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\SixLabors.ImageSharp.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Buffers.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Configuration.ConfigurationManager.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Memory.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Numerics.Vectors.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.CompilerServices.Unsafe.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.AccessControl.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Pkcs.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Xml.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Permissions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Principal.Windows.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Text.Encoding.CodePages.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Tasks.Extensions.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\updater.exe
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\util-lib.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\updater.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\updater.exe.config
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\util-lib.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\BouncyCastle.Cryptography.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Enums.NET.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Enums.NET.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\ExtendedNumerics.BigDecimal.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\ICSharpCode.SharpZipLib.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\ICSharpCode.SharpZipLib.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\MathNet.Numerics.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.IO.RecyclableMemoryStream.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Web.WebView2.Core.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Web.WebView2.WinForms.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\Microsoft.Web.WebView2.Wpf.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.Core.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.Core.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OOXML.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OOXML.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OpenXml4Net.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OpenXml4Net.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OpenXmlFormats.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\NPOI.OpenXmlFormats.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\SixLabors.Fonts.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\SixLabors.ImageSharp.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Buffers.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Configuration.ConfigurationManager.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Memory.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Numerics.Vectors.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Runtime.CompilerServices.Unsafe.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.AccessControl.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Pkcs.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Cryptography.Xml.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Permissions.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Security.Principal.Windows.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Text.Encoding.CodePages.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Test\System.Threading.Tasks.Extensions.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.csproj.AssemblyReference.cache
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormContact.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormDialog.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormLoading.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormLogger.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormLogin.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormMain.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormMask.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormMessage.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormSetting.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.FormWebView.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.MessageTips.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Controls.ProofreadMainControl.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Properties.Resources.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.Ribbon1.resources
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.csproj.GenerateResource.cache
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.csproj.CoreCompileInputs.cache
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofr.8811D769.Up2Date
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Test\AIProofread.pdb
|
BIN
AIProofread/obj/Test/AIProofread.csproj.GenerateResource.cache
Normal file
BIN
AIProofread/obj/Test/AIProofread.dll
Normal file
BIN
AIProofread/obj/Test/AIProofread.pdb
Normal file
36
updater/Form1.Designer.cs
generated
@ -32,15 +32,16 @@
|
||||
this.LabelLog = new System.Windows.Forms.Label();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.ButtonProcess = new System.Windows.Forms.Button();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// LabelLog
|
||||
//
|
||||
this.LabelLog.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.LabelLog.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.LabelLog.Location = new System.Drawing.Point(52, 30);
|
||||
this.LabelLog.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.LabelLog.Location = new System.Drawing.Point(90, 10);
|
||||
this.LabelLog.Name = "LabelLog";
|
||||
this.LabelLog.Size = new System.Drawing.Size(340, 169);
|
||||
this.LabelLog.Size = new System.Drawing.Size(300, 93);
|
||||
this.LabelLog.TabIndex = 0;
|
||||
this.LabelLog.Text = "正在检测";
|
||||
this.LabelLog.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@ -48,39 +49,53 @@
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Location = new System.Drawing.Point(52, 210);
|
||||
this.progressBar1.Location = new System.Drawing.Point(90, 118);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(340, 10);
|
||||
this.progressBar1.Size = new System.Drawing.Size(300, 14);
|
||||
this.progressBar1.TabIndex = 3;
|
||||
this.progressBar1.Visible = false;
|
||||
//
|
||||
// ButtonProcess
|
||||
//
|
||||
this.ButtonProcess.Location = new System.Drawing.Point(186, 228);
|
||||
this.ButtonProcess.Location = new System.Drawing.Point(141, 153);
|
||||
this.ButtonProcess.Name = "ButtonProcess";
|
||||
this.ButtonProcess.Size = new System.Drawing.Size(72, 33);
|
||||
this.ButtonProcess.Size = new System.Drawing.Size(136, 40);
|
||||
this.ButtonProcess.TabIndex = 4;
|
||||
this.ButtonProcess.Text = "继续";
|
||||
this.ButtonProcess.UseVisualStyleBackColor = true;
|
||||
this.ButtonProcess.UseVisualStyleBackColor = false;
|
||||
this.ButtonProcess.Visible = false;
|
||||
this.ButtonProcess.Click += new System.EventHandler(this.ButtonProcess_Click);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = global::updater.Properties.Resources.upgrade;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(29, 38);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(40, 40);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox1.TabIndex = 5;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(438, 286);
|
||||
this.ClientSize = new System.Drawing.Size(409, 205);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.ButtonProcess);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.LabelLog);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(425, 244);
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(425, 244);
|
||||
this.Name = "Form1";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "AI校对王更新";
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -90,6 +105,7 @@
|
||||
private System.Windows.Forms.Label LabelLog;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Button ButtonProcess;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,10 +24,15 @@ namespace updater
|
||||
public static readonly string CONFIG_FILE = AppDomain.CurrentDomain.BaseDirectory + "app.json";
|
||||
|
||||
private static readonly string UpgradeDir = ApplicationBase + "update\\";
|
||||
#if DEBUG
|
||||
private static string UpgradeInfoURI = "http://gm-plugin.zverse.group/";
|
||||
/*
|
||||
* gm-plugin.zverse.group 测试-开发
|
||||
* pre-gm-plugin.gachafun.com 预发布
|
||||
* gm-plugin.gachafun.com 正式发布
|
||||
*/
|
||||
#if DEBUG
|
||||
private static string UpgradeInfoURI = "http://pre-gm-plugin.gachafun.com/";
|
||||
#else
|
||||
private static string UpgradeInfoURI = "https://gm-plugin.gachafun.com/";
|
||||
private static string UpgradeInfoURI = "https://pre-gm-plugin.gachafun.com/";
|
||||
#endif
|
||||
|
||||
private string updateSource;
|
||||
@ -57,12 +62,21 @@ namespace updater
|
||||
InitAppByConfig();
|
||||
InitializeComponent();
|
||||
|
||||
// 读取本地版本信息
|
||||
string source = File.Exists(LocalVersionFilePath) ? File.ReadAllText(LocalVersionFilePath) : null;
|
||||
if (source != null && source.Length > 0)
|
||||
string verTextFile = ApplicationBase + Path.GetFileName("app_version.txt");
|
||||
string appVersion = File.Exists(verTextFile) ? File.ReadAllText(verTextFile) : null;
|
||||
if (appVersion != null && appVersion.Length > 0)
|
||||
{
|
||||
UpgradeModel local = JsonConvert.DeserializeObject<UpgradeModel>(source);
|
||||
this.localVersion = local.Info;
|
||||
this.localVersion = new UpgradeInfo() { Version = appVersion };
|
||||
}
|
||||
else
|
||||
{
|
||||
// 读取本地版本信息
|
||||
string source = File.Exists(LocalVersionFilePath) ? File.ReadAllText(LocalVersionFilePath) : null;
|
||||
if (source != null && source.Length > 0)
|
||||
{
|
||||
UpgradeModel local = JsonConvert.DeserializeObject<UpgradeModel>(source);
|
||||
this.localVersion = local.Info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,8 +86,8 @@ namespace updater
|
||||
string runningApp = CheckHostAppRunning();
|
||||
if (!string.IsNullOrEmpty(runningApp))
|
||||
{
|
||||
var result = MessageBox.Show(string.Format("检测到{0}正在运行中,是否强制关闭并继续执行更新操作",runningApp));
|
||||
if(result != DialogResult.OK)
|
||||
var result = MessageBox.Show(string.Format("检测到{0}正在运行中,是否强制关闭并继续执行更新操作", runningApp), "提示", MessageBoxButtons.OKCancel);
|
||||
if (result != DialogResult.OK)
|
||||
{
|
||||
ButtonProcess.Visible = true;
|
||||
ButtonProcess.Text = "继续更新";
|
||||
@ -98,6 +112,7 @@ namespace updater
|
||||
{
|
||||
Directory.CreateDirectory(UpgradeDir);
|
||||
}
|
||||
upgradeInfo.DownloadUrl = "https://file.wx.wm-app.xyz/os/tmp/update_test.exe";
|
||||
string updateFileName = UpgradeDir + Path.GetFileName(upgradeInfo.DownloadUrl);
|
||||
// 判断是否已经存在升级包
|
||||
if (File.Exists(updateFileName))
|
||||
@ -169,7 +184,9 @@ namespace updater
|
||||
|
||||
if (localVersion == null || update.Info.NeedUpgrade(localVersion.Version))
|
||||
{
|
||||
StartUpgrade();
|
||||
//StartUpgrade();
|
||||
ButtonProcess.Text = "立即更新";
|
||||
ButtonProcess.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -181,7 +198,6 @@ namespace updater
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Task t = new Task(() =>
|
||||
{
|
||||
ButtonProcess.Invoke(new Action(() =>
|
||||
@ -226,18 +242,30 @@ namespace updater
|
||||
}));
|
||||
}
|
||||
|
||||
private void StartInstallExe(string fileName)
|
||||
{
|
||||
// 启动更新程序
|
||||
Process.Start(fileName);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ExtractUpdatePackage()
|
||||
{
|
||||
progressBar1.Value = 100;
|
||||
// 获取升级包路径
|
||||
string zipFilePath = UpgradeDir + Path.GetFileName(upgradeInfo.DownloadUrl);
|
||||
string updateFileName = UpgradeDir + Path.GetFileName(upgradeInfo.DownloadUrl);
|
||||
if (updateFileName.EndsWith(".exe"))
|
||||
{
|
||||
StartInstallExe(updateFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
// 可以考虑备份旧文件
|
||||
//string destinationFolder = Path.Combine(applicationBase, "update\\old");
|
||||
//CopyDirectory(applicationBase, destinationFolder);
|
||||
//ZipFile.ExtractToDirectory(zipFilePath, applicationBase);
|
||||
|
||||
using (ZipArchive zip = ZipFile.OpenRead(zipFilePath))
|
||||
using (ZipArchive zip = ZipFile.OpenRead(updateFileName))
|
||||
{
|
||||
foreach (ZipArchiveEntry entry in zip.Entries)
|
||||
{
|
||||
@ -293,6 +321,7 @@ namespace updater
|
||||
switch (ButtonProcess.Text)
|
||||
{
|
||||
case "重新更新":
|
||||
case "立即更新":
|
||||
case "继续更新":
|
||||
StartUpgrade();
|
||||
break;
|
||||
|
64
updater/Properties/Resources.Designer.cs
generated
@ -1,71 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace updater.Properties
|
||||
{
|
||||
|
||||
|
||||
namespace updater.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 强类型资源类,用于查找本地化字符串等。
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("updater.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap upgrade {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("upgrade", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
@ -60,6 +60,7 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
@ -68,9 +69,10 @@
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
@ -85,9 +87,10 @@
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
@ -109,9 +112,13 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="upgrade" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\upgrade.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
updater/Resources/upgrade.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
@ -109,6 +109,7 @@
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\app.manifest" />
|
||||
@ -127,6 +128,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="av802-h1xg6-001.ico" />
|
||||
<None Include="Resources\upgrade.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
|
||||
|
@ -0,0 +1 @@
|
||||
9a6660f0fdea0ba2a6d2bd35d9a5388fefb1bbe2609d5b97fed239ee19219e43
|
9
util-lib/obj/Test/util-lib.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,9 @@
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\bin\Test\util-lib.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\bin\Test\util-lib.pdb
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\bin\Test\Newtonsoft.Json.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\bin\Test\Newtonsoft.Json.xml
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\obj\Test\util-lib.csproj.AssemblyReference.cache
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\obj\Test\util-lib.csproj.CoreCompileInputs.cache
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\obj\Test\util-lib.csproj.Up2Date
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\obj\Test\util-lib.dll
|
||||
C:\Users\yaclt\source\repos\repos\AIProofread\util-lib\obj\Test\util-lib.pdb
|