feat: 日志底层组件采用log4net

This commit is contained in:
LittleBoy 2025-04-13 13:59:22 +08:00
parent fb2f5e0d16
commit 2bebf743ba
26 changed files with 288 additions and 207 deletions

Binary file not shown.

View File

@ -143,6 +143,9 @@
<Reference Include="ICSharpCode.SharpZipLib, Version=1.4.2.13, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL"> <Reference Include="ICSharpCode.SharpZipLib, Version=1.4.2.13, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll</HintPath> <HintPath>..\packages\SharpZipLib.1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL"> <Reference Include="MathNet.Numerics, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<HintPath>..\packages\MathNet.Numerics.Signed.5.0.0\lib\net461\MathNet.Numerics.dll</HintPath> <HintPath>..\packages\MathNet.Numerics.Signed.5.0.0\lib\net461\MathNet.Numerics.dll</HintPath>
</Reference> </Reference>
@ -198,6 +201,7 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Data.OracleClient" /> <Reference Include="System.Data.OracleClient" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference> </Reference>
@ -238,6 +242,7 @@
<Private>True</Private> <Private>True</Private>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -396,7 +401,7 @@
<Compile Include="core\Tools.cs" /> <Compile Include="core\Tools.cs" />
<Compile Include="core\MainPanelWebMessage.cs" /> <Compile Include="core\MainPanelWebMessage.cs" />
<Compile Include="core\ExportConfig.cs" /> <Compile Include="core\ExportConfig.cs" />
<Compile Include="Logger.cs" /> <Compile Include="LogHelper.cs" />
<Compile Include="Model\BridgeResult.cs" /> <Compile Include="Model\BridgeResult.cs" />
<Compile Include="Model\CommonsenseDetectionItem.cs" /> <Compile Include="Model\CommonsenseDetectionItem.cs" />
<Compile Include="Model\DocumentContent.cs" /> <Compile Include="Model\DocumentContent.cs" />

View File

@ -2,6 +2,7 @@
using AIProofread.core; using AIProofread.core;
using AIProofread.Model; using AIProofread.Model;
using AIProofread.Util; using AIProofread.Util;
using log4net;
using Microsoft.Office.Interop.Word; using Microsoft.Office.Interop.Word;
using Microsoft.Web.WebView2.Core; using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms; using Microsoft.Web.WebView2.WinForms;
@ -45,6 +46,7 @@ namespace AIProofread
private static object missing = System.Reflection.Missing.Value; private static object missing = System.Reflection.Missing.Value;
private static UpgradeData CurrentUpgrade = null; private static UpgradeData CurrentUpgrade = null;
public static readonly ILog Logger = LogHelper.GetLogger(typeof(Bridge));
public void ShowUpgradeView() public void ShowUpgradeView()
{ {
@ -138,7 +140,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); Logger.Error(ex);
} }
} }
@ -247,7 +249,7 @@ namespace AIProofread
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(e); Logger.Error("启动升级程序失败", e);
if (showFail) if (showFail)
{ {
MessageBox.Show("启动升级程序失败,请重试"); MessageBox.Show("启动升级程序失败,请重试");
@ -271,7 +273,7 @@ namespace AIProofread
public void ShowLog(string message) public void ShowLog(string message)
{ {
Logger.Log((Config.IS_WPS ? "WPS" : "WORD") + "-WEB", message); Logger.Info((Config.IS_WPS ? "WPS" : "WORD") + "-WEB " + message);
} }
public void ShowLoginForm(string action) public void ShowLoginForm(string action)
@ -425,13 +427,13 @@ namespace AIProofread
} }
catch (POIXMLException ex) catch (POIXMLException ex)
{ {
Logger.Log(ex); Logger.Error("校对文档格式有误或内容异常", ex);
data["code"] = 5; data["code"] = 5;
data["message"] = "文档格式有误或内容异常,请另存文档后再进行校对"; data["message"] = "文档格式有误或内容异常,请另存文档后再进行校对";
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); Logger.Error("校对文档格式有误或内容异常", ex);
throw ex; throw ex;
} }
//if (loadingDialog != null && !loadingDialog.IsDisposed) //if (loadingDialog != null && !loadingDialog.IsDisposed)
@ -586,7 +588,9 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex);
Logger.Error("初始化web环境失败", ex);
LogHelper.Log(ex);
} }
} }
@ -752,7 +756,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("Initial Content error:" + ex.Message + "\n" + ex.StackTrace + "\n\n"); Logger.Error("Initial Content error:",ex);
return "false"; return "false";
} }
return "true"; return "true";
@ -843,7 +847,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("导出勘误表失败:" + ex.Message + "\n" + ex.StackTrace + "\n\n"); Logger.Error("导出勘误表失败:" + ex.Message,ex);
return BridgeResult.Error(-1, ex.Message); return BridgeResult.Error(-1, ex.Message);
} }
} }
@ -894,7 +898,7 @@ namespace AIProofread
} }
try try
{ {
Logger.Log("SaveCache " + document.fileName + " used " + document.ProofreadCachePath); Logger.Info("SaveCache " + document.fileName + " used " + document.ProofreadCachePath);
if (File.Exists(document.ProofreadCachePath)) if (File.Exists(document.ProofreadCachePath))
{ {
@ -924,7 +928,7 @@ namespace AIProofread
{ {
return BridgeResult.Error(1, "cache-not-exists"); return BridgeResult.Error(1, "cache-not-exists");
} }
Logger.Log("Load cache " + document.fileName + " used " + document.ProofreadCachePath); Logger.Info("Load cache " + document.fileName + " used " + document.ProofreadCachePath);
try try
{ {
return BridgeResult.Success(File.ReadAllText(document.ProofreadCachePath)); return BridgeResult.Success(File.ReadAllText(document.ProofreadCachePath));

View File

@ -1,4 +1,5 @@
using Microsoft.Web.WebView2.Core; using log4net;
using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms; using Microsoft.Web.WebView2.WinForms;
using NPOI.SS.Util; using NPOI.SS.Util;
using System; using System;
@ -16,6 +17,7 @@ namespace AIProofread.Controls
[ComVisible(true)] [ComVisible(true)]
public class BaseWinForm : Form public class BaseWinForm : Form
{ {
#region WIN32 API
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn( private static extern IntPtr CreateRoundRectRgn(
int nLeftRect, // x-coordinate of upper-left corner int nLeftRect, // x-coordinate of upper-left corner
@ -51,6 +53,9 @@ namespace AIProofread.Controls
private const int WM_NCHITTEST = 0x84; // variables for dragging the form private const int WM_NCHITTEST = 0x84; // variables for dragging the form
private const int HTCLIENT = 0x1; private const int HTCLIENT = 0x1;
private const int HTCAPTION = 0x2; private const int HTCAPTION = 0x2;
#endregion
private readonly ILog logger = LogHelper.GetLogger(typeof(BaseWinForm));
protected override CreateParams CreateParams protected override CreateParams CreateParams
{ {
@ -117,7 +122,7 @@ namespace AIProofread.Controls
this.Height = height; this.Height = height;
} }
protected async void InitWebView(WebView2 webView,String url,string name,Action callaback = null) protected async void InitWebView(WebView2 webView, String url, string name, Action callaback = null)
{ {
//Bridge.InitWebEnvAsync(name, webView); //Bridge.InitWebEnvAsync(name, webView);
try try
@ -132,15 +137,16 @@ namespace AIProofread.Controls
webView.CoreWebView2.AddHostObjectToScript("event", eventForwarder); webView.CoreWebView2.AddHostObjectToScript("event", eventForwarder);
webView.CoreWebView2.AddHostObjectToScript("host", this); webView.CoreWebView2.AddHostObjectToScript("host", this);
webView.CoreWebView2.AddHostObjectToScript("bridge", Bridge.bridge); webView.CoreWebView2.AddHostObjectToScript("bridge", Bridge.bridge);
if(callaback != null) if (callaback != null)
{ {
callaback(); callaback();
} }
webView.Source = new Uri(url); webView.Source = new Uri(url);
}catch (Exception ex) }
catch (Exception ex)
{ {
Logger.Log("\ninit webview error:" + ex.Message + "\n" + ex.StackTrace); logger.Error("\ninit webview error:" + ex.Message, ex);
} }
} }
public void Download(string url) public void Download(string url)
@ -170,7 +176,7 @@ namespace AIProofread.Controls
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("\nDownload error:" + ex.Message + "\n" + ex.StackTrace); logger.Error("\nDownload error:" + ex.Message, ex);
} }
} }
} }

View File

@ -96,7 +96,7 @@ namespace AIProofread.Controls
private void FormLogger_FormClosed(object sender, FormClosedEventArgs e) private void FormLogger_FormClosed(object sender, FormClosedEventArgs e)
{ {
Logger.LoggerForm = null; LogHelper.LoggerForm = null;
} }
private void TsmiClear_Click(object sender, EventArgs e) private void TsmiClear_Click(object sender, EventArgs e)

103
AIProofread/LogHelper.cs Normal file
View File

@ -0,0 +1,103 @@
using AIProofread.Controls;
using log4net.Config;
using log4net;
using System;
using System.IO;
using log4net.Appender;
using log4net.Layout;
using log4net.Repository.Hierarchy;
namespace AIProofread
{
public class LogHelper
{
public static FormLogger LoggerForm;
//private static readonly string AppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
public static ILog Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
static LogHelper()
{
//log4net.GlobalContext.Properties["APP_DATA"] = Config.APP_LOG_PATH;
//XmlConfigurator.Configure();
//Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
Hierarchy hierarchy = (Hierarchy)LogManager.GetRepository();
PatternLayout layout = new PatternLayout("%date [%thread] %-5level %logger - %message%newline");
layout.ActivateOptions();
//string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
//string logFilePath = Path.Combine(appDataPath, "YourAppName", "logs");
RollingFileAppender roller = new RollingFileAppender();
roller.File = Config.APP_LOG_PATH;
roller.AppendToFile = true;
roller.RollingStyle = RollingFileAppender.RollingMode.Date;
roller.DatePattern = "yyyy-MM-dd'.txt'";
roller.StaticLogFileName = false;
roller.Layout = layout;
roller.ActivateOptions();
hierarchy.Root.AddAppender(roller);
hierarchy.Root.Level = log4net.Core.Level.Debug;
hierarchy.Configured = true;
}
/// <summary>
///
/// </summary>
/// <param name="msg"></param>
public static void Log(string tag, string message)
{
string time = DateTime.Now.ToString("HH:mm:ss");
// 如果日志窗口已经打开,则显示日志
if (LoggerForm != null && !LoggerForm.IsDisposed && LoggerForm.Visible)
{
LoggerForm.Log(time, tag, message);
}
if (!Directory.Exists(Config.APP_LOG_PATH))
{
Directory.CreateDirectory(Config.APP_LOG_PATH);
}
Logger.Debug($"[{tag}] {message}");
//try
//{
// string path = Config.APP_LOG_PATH + DateTime.Now.ToString("yyyy-MM-dd") + ".txt";
// StreamWriter streamWriter = File.AppendText(path);
// streamWriter.WriteLine("***************************[" + tag + "]***************************");
// streamWriter.WriteLine("消息:" + message);
// streamWriter.WriteLine("时间:" + time);
// streamWriter.WriteLine();
// streamWriter.Flush();
// streamWriter.Close();
// streamWriter.Dispose();
//}
//catch (Exception) { }
}
public static void Log(string msg)
{
Log((Config.IS_WPS ? "WPS" : "WORD"), msg);
}
public static void Log(Exception e)
{
Logger.Error(Config.IS_WPS ? "WPS" : "WORD" + e.ToString(), e);
//Log(e.Message + "\n" + e.StackTrace);
}
public static void Log(string tag, Exception e)
{
Logger.Error(tag, e);
}
public static void LogToWeb(string msg)
{
if (Config.RUN_IN_DEBUG)
{
Globals.ThisAddIn.SendMessageToWeb("DEBUG-LOG", msg);
}
}
internal static ILog GetLogger(Type type)
{
return LogManager.GetLogger(type);
}
}
}

View File

@ -1,66 +0,0 @@
using AIProofread.Controls;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Interop;
namespace AIProofread
{
public class Logger
{
public static FormLogger LoggerForm;
//private static readonly string AppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
/// <summary>
///
/// </summary>
/// <param name="msg"></param>
public static void Log(string tag,string message)
{
string time = DateTime.Now.ToString("HH:mm:ss");
// 如果日志窗口已经打开,则显示日志
if (LoggerForm != null && !LoggerForm.IsDisposed && LoggerForm.Visible)
{
LoggerForm.Log(time, tag, message);
}
string path = Config.APP_LOG_PATH + DateTime.Now.ToString("yyyy-MM-dd") + ".txt";
if (!Directory.Exists(Config.APP_LOG_PATH))
{
Directory.CreateDirectory(Config.APP_LOG_PATH);
}
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) { }
}
public static void Log(string msg)
{
Log((Config.IS_WPS ? "WPS" : "WORD"), msg);
}
public static void Log(Exception e)
{
Log(e.Message + "\n" + e.StackTrace);
}
public static void Log(string tag, Exception e)
{
Log(tag,e.Message + "\n" + e.StackTrace);
}
public static void LogToWeb(string msg)
{
if (Config.RUN_IN_DEBUG)
{
Globals.ThisAddIn.SendMessageToWeb("DEBUG-LOG", msg);
}
}
}
}

View File

@ -227,7 +227,7 @@ namespace AIProofread.Model
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log("Error", e); LogHelper.Log("Error", e);
} }
} }
@ -539,7 +539,7 @@ namespace AIProofread.Model
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("GlobalCallback", "call web global function error \n" + ex.Message + "\n" + callbackId + result); LogHelper.Log("GlobalCallback", "call web global function error \n" + ex.Message + "\n" + callbackId + result);
} }
} }
public void SendMessageToWeb(string msg, object data) public void SendMessageToWeb(string msg, object data)
@ -556,7 +556,7 @@ namespace AIProofread.Model
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("SendMessage", "send message to web error \n" + ex.Message + "\n" + msg + data.ToString()); LogHelper.Log("SendMessage", "send message to web error \n" + ex.Message + "\n" + msg + data.ToString());
} }
} }
@ -580,7 +580,7 @@ namespace AIProofread.Model
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("ClearAllProofreadMark", ex); LogHelper.Log("ClearAllProofreadMark", ex);
} }
// 清空marks // 清空marks
marks.Clear(); marks.Clear();
@ -658,9 +658,9 @@ namespace AIProofread.Model
List<InsertMarkData> insertMarks = new List<InsertMarkData>(); List<InsertMarkData> insertMarks = new List<InsertMarkData>();
foreach (var correct in list) foreach (var correct in list)
{ {
if(Logger.LoggerForm != null) if(LogHelper.LoggerForm != null)
{ {
Logger.Log(string.Format("correct content:{0}", correct.Insert)); LogHelper.Log(string.Format("correct content:{0}", correct.Insert));
} }
int currentOffset = correct.SentenceOffset; int currentOffset = correct.SentenceOffset;
if (correct.CorrectItems != null && correct.CorrectItems.Count > 0) if (correct.CorrectItems != null && correct.CorrectItems.Count > 0)
@ -707,7 +707,7 @@ namespace AIProofread.Model
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(string.Format("mark color error {0}", e.Message)); LogHelper.Log(string.Format("mark color error {0}", e.Message));
} }
} }
else else
@ -720,7 +720,7 @@ namespace AIProofread.Model
{ "new_text",correct.NewText }, { "new_text",correct.NewText },
{ "paragraph_num",correct.ParagraphNumber }, { "paragraph_num",correct.ParagraphNumber },
}; };
Logger.Log(JsonConvert.SerializeObject(msg)); LogHelper.Log(JsonConvert.SerializeObject(msg));
} }
} }
} }
@ -796,7 +796,7 @@ namespace AIProofread.Model
pi.originBackgroundColor = info.Background; pi.originBackgroundColor = info.Background;
pi.originSize = info.Size; pi.originSize = info.Size;
} }
catch (Exception ex) { Logger.Log(ex); } catch (Exception ex) { LogHelper.Log(ex); }
} }
marks.Add(item.Id, pi); marks.Add(item.Id, pi);
} }
@ -902,7 +902,7 @@ namespace AIProofread.Model
CurrentDocument.Save(); CurrentDocument.Save();
}catch (Exception ex) }catch (Exception ex)
{ {
Logger.Log(ex); LogHelper.Log(ex);
} }
} }
public void FocusToPanel() public void FocusToPanel()
@ -924,7 +924,7 @@ namespace AIProofread.Model
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); LogHelper.Log(ex);
} }
} }
@ -1037,7 +1037,7 @@ namespace AIProofread.Model
internal void CheckPanel() internal void CheckPanel()
{ {
Logger.Log(CurrentDocument.FullName + $" TaskPane visible {PaneVisible} has " + (TaskPane == null ? "null" : "exists")); LogHelper.Log(CurrentDocument.FullName + $" TaskPane visible {PaneVisible} has " + (TaskPane == null ? "null" : "exists"));
if (TaskPane == null) CreateTaskPane(); if (TaskPane == null) CreateTaskPane();
} }
} }

View File

@ -28,7 +28,8 @@ namespace AIProofread.Model
{ {
var sentence = item.OriginSentence; var sentence = item.OriginSentence;
var isInsert = item.content.Tag == "i"; var isInsert = item.content.Tag == "i";
if (sentence.Length <= MAX_WORD_LENGTH && !isInsert) var limitLength = Math.Max(item.content.Origin.Length, MAX_WORD_LENGTH);
if (sentence.Length <= limitLength && !isInsert)
{ {
return sentence; return sentence;
} }
@ -37,18 +38,18 @@ namespace AIProofread.Model
Debug.WriteLine("GetReadDocumentFilePath Start ==>", DateTime.Now.ToLongTimeString()); Debug.WriteLine("GetReadDocumentFilePath Start ==>", DateTime.Now.ToLongTimeString());
} }
// 截取中间位置 // 截取中间位置
if(sentence.Length > MAX_WORD_LENGTH) if(sentence.Length > limitLength)
{ {
try try
{ {
var middlePosition = MAX_WORD_LENGTH / 2; var middlePosition = limitLength / 2;
var cutStart = item.content.Start - middlePosition; var cutStart = item.content.Start - middlePosition;
// 越界了 // 越界了
if (cutStart < 0) if (cutStart < 0)
{ {
cutStart = 0; cutStart = 0;
} }
var originText = sentence.Substring(cutStart, Math.Min(sentence.Length - cutStart, MAX_WORD_LENGTH)); var originText = sentence.Substring(cutStart, Math.Min(sentence.Length - cutStart, limitLength));
if (!isInsert) if (!isInsert)
{ {
item.content.Start = item.content.Start - cutStart; item.content.Start = item.content.Start - cutStart;
@ -58,11 +59,11 @@ namespace AIProofread.Model
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); LogHelper.Log(ex);
} }
} }
var sb = new StringBuilder(); var sb = new StringBuilder();
if (sentence.Length <= MAX_WORD_LENGTH && isInsert) if (sentence.Length <= limitLength && isInsert)
{ {
var before = item.content.Start == 0 ? string.Empty: sentence.Substring(0, item.content.Start); var before = item.content.Start == 0 ? string.Empty: sentence.Substring(0, item.content.Start);
var after = item.content.Start >= sentence.Length ? string.Empty : sentence.Substring(item.content.Start); var after = item.content.Start >= sentence.Length ? string.Empty : sentence.Substring(item.content.Start);

View File

@ -96,7 +96,7 @@ namespace UtilLib
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(e); LogHelper.Log(e);
} }
} }
@ -113,7 +113,7 @@ namespace UtilLib
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(e); LogHelper.Log(e);
} }
} }
@ -131,7 +131,7 @@ namespace UtilLib
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(e); LogHelper.Log(e);
} }
} }
private void PrepareCommentProcess(Bookmark mark) private void PrepareCommentProcess(Bookmark mark)
@ -148,13 +148,13 @@ namespace UtilLib
// 判断当前书签选区内容是否有评论 // 判断当前书签选区内容是否有评论
if (comments != null && comments.Count > 0) if (comments != null && comments.Count > 0)
{ {
Logger.Log("有批注"); LogHelper.Log("有批注");
foreach (Microsoft.Office.Interop.Word.Comment item in comments) foreach (Microsoft.Office.Interop.Word.Comment item in comments)
{ {
// 判断当前评论和书签选区是否一致 // 判断当前评论和书签选区是否一致
if (item.Scope.Start == range.Start && item.Scope.End == range.End) if (item.Scope.Start == range.Start && item.Scope.End == range.End)
{ {
Logger.Log("删除批注:" + item.Range.Text); LogHelper.Log("删除批注:" + item.Range.Text);
// 删除评论 // 删除评论
item.Delete(); item.Delete();
} }
@ -224,7 +224,7 @@ namespace UtilLib
if (rng.Text?.IndexOf("%") != -1) if (rng.Text?.IndexOf("%") != -1)
{ {
Logger.Log($"处理百分号问题:有批注"); LogHelper.Log($"处理百分号问题:有批注");
if (rng.Comments != null && rng.Comments.Count > 0) if (rng.Comments != null && rng.Comments.Count > 0)
{ {
for (var i = 1; i < rng.Comments.Count; i++) for (var i = 1; i < rng.Comments.Count; i++)

View File

@ -124,7 +124,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(this.Name, ex); LogHelper.Log(this.Name, ex);
} }
} }
Globals.ThisAddIn.LoginFormList.Clear(); Globals.ThisAddIn.LoginFormList.Clear();
@ -459,7 +459,7 @@ namespace AIProofread
} }
catch (Exception exception) catch (Exception exception)
{ {
Logger.Log(exception); LogHelper.Log(exception);
} }
return result; return result;
} }
@ -483,12 +483,12 @@ namespace AIProofread
private void BtnOpenLogger_Click(object sender, RibbonControlEventArgs e) private void BtnOpenLogger_Click(object sender, RibbonControlEventArgs e)
{ {
// 判断日志窗口是否已经存在或者打开 // 判断日志窗口是否已经存在或者打开
if (Logger.LoggerForm == null || Logger.LoggerForm.IsDisposed) if (LogHelper.LoggerForm == null || LogHelper.LoggerForm.IsDisposed)
{ {
// 创建日志窗口 // 创建日志窗口
Logger.LoggerForm = new FormLogger(); LogHelper.LoggerForm = new FormLogger();
} }
Logger.LoggerForm.Show(); LogHelper.LoggerForm.Show();
} }
private int GetRangeParagraphNumber(Range range) private int GetRangeParagraphNumber(Range range)

View File

@ -8,8 +8,7 @@ using AIProofread.Controls;
using UtilLib; using UtilLib;
using AIProofread.Model; using AIProofread.Model;
using System.Collections.Generic; using System.Collections.Generic;
using Excel = Microsoft.Office.Interop.Excel; using log4net;
using System.Runtime.InteropServices;
namespace AIProofread namespace AIProofread
@ -17,7 +16,8 @@ namespace AIProofread
public partial class ThisAddIn public partial class ThisAddIn
{ {
// LogManager.GetLogger(typeof(ThisAddIn))
public ILog Logger = LogHelper.GetLogger(typeof(ThisAddIn));
public static SynchronizationContext FmainThreadContext; public static SynchronizationContext FmainThreadContext;
public string AddinName = " "; public string AddinName = " ";
@ -92,12 +92,12 @@ namespace AIProofread
private void ProcessApplicationException(object sender, UnhandledExceptionEventArgs e) private void ProcessApplicationException(object sender, UnhandledExceptionEventArgs e)
{ {
Logger.Log("UnhandledException", e.ExceptionObject as Exception); Logger.Error("UnhandledException", e.ExceptionObject as Exception);
} }
private void ProcessApplicationFormException(object sender, System.Threading.ThreadExceptionEventArgs e) private void ProcessApplicationFormException(object sender, System.Threading.ThreadExceptionEventArgs e)
{ {
Logger.Log("ProcessApplicationFormException", e.Exception); Logger.Error("ProcessApplicationFormException", e.Exception);
} }
private void ThisAddIn_Startup(object sender, System.EventArgs e) private void ThisAddIn_Startup(object sender, System.EventArgs e)
@ -109,7 +109,7 @@ namespace AIProofread
//formCommonsenseDetection.ShowInTaskbar = false; //formCommonsenseDetection.ShowInTaskbar = false;
//formCommonsenseDetection.Show(); //formCommonsenseDetection.Show();
Logger.Log("ThisAddIn_Startup IS_WPS --> " + IsWPS); Logger.Debug("ThisAddIn_Startup Platform --> " + (IsWPS?"WPS":"WORD"));
// 捕获全局异常 // 捕获全局异常
AppDomain.CurrentDomain.UnhandledException += ProcessApplicationException; AppDomain.CurrentDomain.UnhandledException += ProcessApplicationException;
System.Windows.Forms.Application.ThreadException += ProcessApplicationFormException; System.Windows.Forms.Application.ThreadException += ProcessApplicationFormException;
@ -137,7 +137,7 @@ namespace AIProofread
} }
catch (Exception ex1) catch (Exception ex1)
{ {
Logger.Log("Startup Error" + ex1.ToString()); Logger.Error("Startup Error",ex1);
} }
} }
@ -156,12 +156,12 @@ namespace AIProofread
if (!string.IsNullOrEmpty(deviceId)) if (!string.IsNullOrEmpty(deviceId))
{ {
Config.DeviceId = deviceId; Config.DeviceId = deviceId;
Logger.Log("设备唯一标识:" + deviceId); Logger.Debug("设备唯一标识:" + deviceId);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("InitDeviceId Error:" + ex.ToString()); Logger.Error("InitDeviceId Error:",ex);
} }
}); });
} }
@ -193,7 +193,7 @@ namespace AIProofread
} }
if (!existsList.Contains(currentName)) if (!existsList.Contains(currentName))
{ {
Logger.Log("检测到文档关闭,已移除:" + currentName); Logger.Debug("检测到文档关闭,已移除:" + currentName);
try try
{ {
item.RunInMainThread(() => item.RunInMainThread(() =>
@ -203,7 +203,7 @@ namespace AIProofread
} }
catch (Exception ext) catch (Exception ext)
{ {
Logger.Log(ext); Logger.Debug(ext);
} }
try try
@ -212,14 +212,14 @@ namespace AIProofread
} }
catch (Exception ext) catch (Exception ext)
{ {
Logger.Log(ext); Logger.Debug(ext);
} }
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); Logger.Debug(ex.Message,ex);
} }
//await System.Threading.Tasks.Task.Run(() => //await System.Threading.Tasks.Task.Run(() =>
// { // {
@ -244,14 +244,14 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("检测升级信息异常: " + ex.ToString()); Logger.Error("检测升级信息异常: ",ex);
} }
}); });
} }
private void Application_DocumentBeforeSave(Document originDocument, ref bool SaveAsUI, ref bool Cancel) private void Application_DocumentBeforeSave(Document originDocument, ref bool SaveAsUI, ref bool Cancel)
{ {
Logger.Log("DocumentSave", originDocument.Name + "\r\n"); //LogHelper.Log("DocumentSave", originDocument.Name + "\r\n");
if (CurrentWordApplication.Documents.Count == 0) if (CurrentWordApplication.Documents.Count == 0)
{ {
return; return;
@ -286,7 +286,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("Init WPS Error " + ex.Message); Logger.Error("Init WPS Error ",ex);
} }
} }
string verTextFile = Config.APP_BASE_DIR + Path.GetFileName("app_version.txt"); string verTextFile = Config.APP_BASE_DIR + Path.GetFileName("app_version.txt");
@ -296,7 +296,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("Write App Version Error " + ex.Message); Logger.Error("Write App Version Error ", ex);
} }
} }
@ -307,7 +307,7 @@ namespace AIProofread
if (File.Exists(Config.CONFIG_FILE)) if (File.Exists(Config.CONFIG_FILE))
{ {
string content = File.ReadAllText(Config.CONFIG_FILE); string content = File.ReadAllText(Config.CONFIG_FILE);
Logger.Log("INIT", "Found app.json " + content); //LogHelper.Log("INIT", "Found app.json " + content);
if (content == null || content.Length == 0) return; if (content == null || content.Length == 0) return;
AppConfig config = JsonConvert.DeserializeObject<AppConfig>(content); AppConfig config = JsonConvert.DeserializeObject<AppConfig>(content);
@ -348,7 +348,7 @@ namespace AIProofread
if (formCommonsenseDetection != null) { if (formCommonsenseDetection != null) {
formCommonsenseDetection.SendMessageToWeb("document-change", null); formCommonsenseDetection.SendMessageToWeb("document-change", null);
} }
Logger.Log("Application_DocumentChange -- " + ActiveDocument.fileName + " track is " + ActiveDocument.CurrentDocument.TrackRevisions); //LogHelper.Log("Application_DocumentChange -- " + ActiveDocument.fileName + " track is " + ActiveDocument.CurrentDocument.TrackRevisions);
} }
public void SetActiveDocument(Document doc) public void SetActiveDocument(Document doc)
@ -373,8 +373,11 @@ namespace AIProofread
/// <param name="Wn"></param> /// <param name="Wn"></param>
private void Application_WindowActivate(Document activeDoc, Window Wn) private void Application_WindowActivate(Document activeDoc, Window Wn)
{ {
ActiveDocument = documentList.SetActiveDocument(activeDoc); if(activeDoc != null && (ActiveDocument == null || activeDoc != ActiveDocument.CurrentDocument))
Logger.Log("Application_WindowActivate -- " + ActiveDocument.fileName); {
ActiveDocument = documentList.SetActiveDocument(activeDoc);
Logger.Info("Application_WindowActivate -- " + ActiveDocument.fileName);
}
//// 当前文档添加书签集合 //// 当前文档添加书签集合
//if (!allMarks.ContainsKey(activeDoc)) //if (!allMarks.ContainsKey(activeDoc))
//{ //{
@ -411,7 +414,7 @@ namespace AIProofread
{ {
doc.HidePane(); doc.HidePane();
} }
Logger.Log("DocumentBeforeClose", currentDoc.FullName); //LogHelper.Log("DocumentBeforeClose", currentDoc.FullName);
//if (allMarks.ContainsKey(currentDoc)) //if (allMarks.ContainsKey(currentDoc))
//{ //{
// allMarks.Remove(currentDoc); // allMarks.Remove(currentDoc);
@ -433,12 +436,12 @@ namespace AIProofread
private void Application_NewDocument(Document doc) private void Application_NewDocument(Document doc)
{ {
Logger.Log("NewDocument" + doc.Name); //LogHelper.Log("NewDocument" + doc.Name);
} }
private void Application_DocumentOpen(Document doc) private void Application_DocumentOpen(Document doc)
{ {
Logger.Log("DocumentOpen " + doc.Name); //LogHelper.Log("DocumentOpen " + doc.Name);
} }
@ -565,7 +568,7 @@ namespace AIProofread
// 取消捕获全局异常事件 // 取消捕获全局异常事件
AppDomain.CurrentDomain.UnhandledException -= ProcessApplicationException; AppDomain.CurrentDomain.UnhandledException -= ProcessApplicationException;
System.Windows.Forms.Application.ThreadException -= ProcessApplicationFormException; System.Windows.Forms.Application.ThreadException -= ProcessApplicationFormException;
Logger.Log("shutdown"); Logger.Debug("shutdown");
documentList.Clear(); documentList.Clear();
if (_timer != null) if (_timer != null)
{ {

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
@ -28,4 +31,54 @@
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<log4net>
<!-- Define some output appenders -->
<appender name="rollingAppender" type="log4net.Appender.RollingFileAppender">
<file value="${APP_DATA}"/>
<!--追加日志内容-->
<appendToFile value="true"/>
<!--防止多线程时不能写Log,官方说线程非安全-->
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<!--可以为:Once|Size|Date|Composite-->
<!--Composite为Size和Date的组合-->
<rollingStyle value="Composite"/>
<!--当备份文件时,为文件名加的后缀,这里可以作为每一天的日志分别存储不同的文件-->
<datePattern value="yyyy-MM-dd&quot;.txt&quot;"/>
<StaticLogFileName value="false"/>
<!--日志最大个数,都是最新的-->
<!--rollingStyle节点为Size时,只能有value个日志-->
<!--rollingStyle节点为Composite时,每天有value个日志-->
<maxSizeRollBackups value="20"/>
<!--可用的单位:KB|MB|GB-->
<maximumFileSize value="5MB"/>
<!--置为true,当前最新日志文件名永远为file节中的名字-->
<staticLogFileName value="true"/>
<!--输出级别在INFO和ERROR之间的日志-->
<filter type="log4net.Filter.LevelRangeFilter">
<param name="LevelMin" value="DEBUG"/>
<param name="LevelMax" value="FATAL"/>
</filter>
<layout type="log4net.Layout.PatternLayout">
<!--日志输出格式:时间 日志类型 日志内容-->
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
</layout>
</appender>
<!-- levels: OFF > FATAL > ERROR > WARN > INFO > DEBUG > ALL -->
<root>
<priority value="ALL"/>
<level value="ALL"/>
<appender-ref ref="rollingAppender"/>
</root>
</log4net>
</configuration> </configuration>

View File

@ -6,11 +6,14 @@ using System.Windows.Forms;
using UtilLib; using UtilLib;
using System.Diagnostics; using System.Diagnostics;
using System; using System;
using log4net;
namespace AIProofread.core namespace AIProofread.core
{ {
public class CorrectResultExportor public class CorrectResultExportor
{ {
public ILog Logger = LogHelper.GetLogger(typeof(CorrectResultExportor));
// 设置表头 // 设置表头
private static readonly string[] HeaderCols = private static readonly string[] HeaderCols =
{ {
@ -213,54 +216,8 @@ namespace AIProofread.core
//sheet.Append(new AutoFilter() { Reference = "A1:G1"}); //sheet.Append(new AutoFilter() { Reference = "A1:G1"});
} }
#region
//var headerRange = worksheet.Range["A1:G1"];
//var allRange = worksheet.Range["A1:G" + rowIndex];
//// 对齐方式
//// 所有都是垂直居中
//allRange.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
//// 水平居中
//headerRange.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
//worksheet.Columns["A:C"].HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
//worksheet.Columns["G"].HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
//// 全局样式
//allRange.Font.Size = 11;
//worksheet.Rows[1].RowHeight = 40;
//// 设置自动换行
//worksheet.Rows.WrapText = true;
//var themeColor = new XSSFColor(new byte[] { 214, 170, 105 }); // 首行背景色黑色,字体用主题金色
//// 设置背景/颜色
//headerRange.Font.Color = ColorTranslator.ToOle(Color.FromArgb(255, 214, 170, 105));
//headerRange.Interior.Pattern = Excel.XlPattern.xlPatternSolid;
//headerRange.Interior.Color = ColorTranslator.ToOle(Color.Black);
//// 设置字体
//worksheet.Rows[1].Font.Name = "黑体";
//worksheet.Columns["G"].Font.Name = "黑体";
// 设置列宽
//worksheet.Columns["A:C"].ColumnWidth = 10;
//worksheet.Columns["D"].ColumnWidth = 80;
//worksheet.Columns["E:F"].ColumnWidth = 20;
//worksheet.Columns["G"].ColumnWidth = 10;
// 设置冻结、筛选
//worksheet.Activate();
//worksheet.Range["B1"].Select(); // 必须选择冻结点
// // 冻结第一行
//excel.ActiveWindow.SplitRow = 1;
//excel.ActiveWindow.FreezePanes = true;
//worksheet.EnableAutoFilter = true;
//// 设置第一行筛选
////int lastRow = worksheet.UsedRange.Rows.Count;
//Excel.Range range = worksheet.get_Range("A1", "D1");
//range.AutoFilter("1", "<>", Excel.XlAutoFilterOperator.xlOr, "", true);
#endregion
stopwatch.Stop(); stopwatch.Stop();
MessageBox.Show("导出完成,运行时间:" + stopwatch.Elapsed.TotalMilliseconds + "毫秒"); Logger.Info("导出勘误表"+fileName+"完成,运行时间:" + stopwatch.Elapsed.TotalMilliseconds + "毫秒");
} }
@ -268,7 +225,8 @@ namespace AIProofread.core
{ {
// 设置列宽 // 设置列宽
Columns columns = new Columns(); Columns columns = new Columns();
SetColumnWidth(1, 3, 6, columns); SetColumnWidth(1, 0, columns); // 隐藏第一列
SetColumnWidth(2, 3, 6, columns);
SetColumnWidth(4, 80, columns); SetColumnWidth(4, 80, columns);
SetColumnWidth(5, 6, 20, columns); SetColumnWidth(5, 6, 20, columns);
SetColumnWidth(7, 10, columns); SetColumnWidth(7, 10, columns);
@ -287,9 +245,10 @@ namespace AIProofread.core
Min = startColIndex, // 从第1列开始 Min = startColIndex, // 从第1列开始
Max = endColIndex, // 到第3列结束 Max = endColIndex, // 到第3列结束
Width = width, // 宽度值(一般 8.43 为默认) Width = width, // 宽度值(一般 8.43 为默认)
CustomWidth = true CustomWidth = true,
Hidden = width <= 0,
} }
); );
} }
private void CreateHeader(SheetData sheetData) private void CreateHeader(SheetData sheetData)

View File

@ -117,7 +117,7 @@ namespace AIProofread
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log("remove mark", e); LogHelper.Log("remove mark", e);
} }
} }
} }
@ -254,7 +254,7 @@ namespace AIProofread
{ "search_end",range.End }, { "search_end",range.End },
{ "search_text",range.Text } { "search_text",range.Text }
}; };
Logger.Log(JsonConvert.SerializeObject(msg1)); LogHelper.Log(JsonConvert.SerializeObject(msg1));
//while (range.Find.Found) //while (range.Find.Found)
//{ //{
// var obj4 = range.Document; // var obj4 = range.Document;
@ -299,7 +299,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); LogHelper.Log(ex);
} }
return null; return null;
} }
@ -327,7 +327,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); LogHelper.Log(ex);
} }
return null; return null;
@ -381,7 +381,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log("create mark error:" + ex.Message + "\n" + ex.StackTrace + "\n\n"); LogHelper.Log("create mark error:" + ex.Message + "\n" + ex.StackTrace + "\n\n");
} }
return bookmark; return bookmark;
} }
@ -521,7 +521,7 @@ namespace AIProofread
if (prevOffset >= paraText.Length) if (prevOffset >= paraText.Length)
{ {
// 查找位置已经超过了整段长度了 // 查找位置已经超过了整段长度了
Logger.Log("prevOffset:" + prevOffset + " paraText.Length:" + paraText.Length); LogHelper.Log("prevOffset:" + prevOffset + " paraText.Length:" + paraText.Length);
return null; return null;
} }
// 执行查找 // 执行查找
@ -604,10 +604,11 @@ namespace AIProofread
} }
//ProcessExport(sfd.FileName); //ProcessExport(sfd.FileName);
CorrectResultExportor.GetInstance().ExportResult(sfd.FileName); CorrectResultExportor.GetInstance().ExportResult(sfd.FileName);
Globals.ThisAddIn.ActiveDocument?.ShowMessage("导出勘误表成功", 2000, false);
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(e); LogHelper.Log(e);
Globals.ThisAddIn.ShowDialog("导出勘误表失败,请重试", null, null); Globals.ThisAddIn.ShowDialog("导出勘误表失败,请重试", null, null);
} }
} }
@ -750,7 +751,7 @@ namespace AIProofread
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Log(e); LogHelper.Log(e);
} }
var oriCell = row.CreateCell(3); var oriCell = row.CreateCell(3);
@ -861,7 +862,7 @@ namespace AIProofread
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Log(ex); LogHelper.Log(ex);
} }
id++; id++;
} }
@ -869,7 +870,6 @@ namespace AIProofread
// 保存到文件 // 保存到文件
book.Write(fs); book.Write(fs);
//Globals.ThisAddIn.ShowMessage("导出成功", 3000); //Globals.ThisAddIn.ShowMessage("导出成功", 3000);
Globals.ThisAddIn.ActiveDocument?.ShowMessage("导出勘误表成功", 2000, false);
} }
} }

View File

@ -1 +1 @@
80a1b62e50022f6927ea33d64c401a80d068064724a07da1ca8562102f036978 6ff77d6c12210febf10f5ae1faf45dfc8ef42d08e43da0240ffa9d92fbefb595

View File

@ -216,3 +216,12 @@ C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AIProofread.
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AntdUI.dll C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AntdUI.dll
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AntdUI.xml C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AntdUI.xml
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormCommonsenseDetection.resources C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormCommonsenseDetection.resources
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.FormLexicon.resources
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\System.ComponentModel.Annotations.dll
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\DocumentFormat.OpenXml.dll
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\DocumentFormat.OpenXml.Framework.dll
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\DocumentFormat.OpenXml.xml
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\DocumentFormat.OpenXml.Framework.xml
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\log4net.dll
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\log4net.pdb
C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\log4net.xml

View File

@ -5,6 +5,7 @@
<package id="DocumentFormat.OpenXml.Framework" version="3.3.0" targetFramework="net462" /> <package id="DocumentFormat.OpenXml.Framework" version="3.3.0" targetFramework="net462" />
<package id="Enums.NET" version="4.0.1" targetFramework="net462" /> <package id="Enums.NET" version="4.0.1" targetFramework="net462" />
<package id="ExtendedNumerics.BigDecimal" version="2025.1001.2.129" targetFramework="net462" /> <package id="ExtendedNumerics.BigDecimal" version="2025.1001.2.129" targetFramework="net462" />
<package id="log4net" version="3.0.4" targetFramework="net462" />
<package id="MathNet.Numerics.Signed" version="5.0.0" targetFramework="net462" /> <package id="MathNet.Numerics.Signed" version="5.0.0" targetFramework="net462" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net462" /> <package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net462" />
<package id="Microsoft.Web.WebView2" version="1.0.2210.55" targetFramework="net462" /> <package id="Microsoft.Web.WebView2" version="1.0.2210.55" targetFramework="net462" />

View File

@ -35,7 +35,7 @@
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.IconClose = new System.Windows.Forms.PictureBox(); this.IconClose = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.panelLog = new System.Windows.Forms.Panel(); this.panelLog = new AntdUI.Panel();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.IconClose)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.IconClose)).BeginInit();
this.panelLog.SuspendLayout(); this.panelLog.SuspendLayout();
@ -44,12 +44,12 @@
// LabelLog // LabelLog
// //
this.LabelLog.AutoEllipsis = true; this.LabelLog.AutoEllipsis = true;
this.LabelLog.BackColor = System.Drawing.Color.Transparent;
this.LabelLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.LabelLog.Font = new System.Drawing.Font("微软雅黑", 10F); this.LabelLog.Font = new System.Drawing.Font("微软雅黑", 10F);
this.LabelLog.Location = new System.Drawing.Point(2, 2); this.LabelLog.Location = new System.Drawing.Point(5, 5);
this.LabelLog.MaximumSize = new System.Drawing.Size(296, 114);
this.LabelLog.MinimumSize = new System.Drawing.Size(296, 114);
this.LabelLog.Name = "LabelLog"; this.LabelLog.Name = "LabelLog";
this.LabelLog.Size = new System.Drawing.Size(296, 114); this.LabelLog.Size = new System.Drawing.Size(290, 100);
this.LabelLog.TabIndex = 0; this.LabelLog.TabIndex = 0;
this.LabelLog.Text = "版本检测中 ..."; this.LabelLog.Text = "版本检测中 ...";
this.LabelLog.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.LabelLog.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -114,10 +114,13 @@
// //
// panelLog // panelLog
// //
this.panelLog.Back = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(248)))), ((int)(((byte)(249)))));
this.panelLog.Controls.Add(this.LabelLog); this.panelLog.Controls.Add(this.LabelLog);
this.panelLog.Location = new System.Drawing.Point(40, 58); this.panelLog.Location = new System.Drawing.Point(40, 60);
this.panelLog.Name = "panelLog"; this.panelLog.Name = "panelLog";
this.panelLog.Size = new System.Drawing.Size(300, 114); this.panelLog.Padding = new System.Windows.Forms.Padding(5);
this.panelLog.Radius = 4;
this.panelLog.Size = new System.Drawing.Size(300, 110);
this.panelLog.TabIndex = 8; this.panelLog.TabIndex = 8;
// //
// Form1 // Form1
@ -155,7 +158,7 @@
private System.Windows.Forms.PictureBox IconClose; private System.Windows.Forms.PictureBox IconClose;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panelLog; private AntdUI.Panel panelLog;
} }
} }