ai_office_plugin/AIProofread/Controls/ProofreadMainControl.cs
callmeyan 089e0bc64a 更新数据交互流程;
优化框架架构;
调整数据结构;
2024-11-05 13:40:39 +08:00

48 lines
1.3 KiB
C#

using Microsoft.Office.Interop.Word;
using Microsoft.Web.WebView2.Core;
using System;
using System.Windows.Forms;
namespace AIProofread.Controls
{
public partial class ProofreadMainControl : UserControl
{
public ProofreadMainControl()
{
InitializeComponent();
Bridge.InitWebEnvAsync("main", web);
//this.minWidth = 420 * LabelWidth() / 42;
//this.MinimumSize = new System.Drawing.Size(this.minWidth, 0);
}
private void ProofreadMainControl_Load(object sender, EventArgs e)
{
this.web.Source = new Uri(Config.WebPath("correct?version=" + Config.APP_VERSION + "&t=" + DateTime.Now.Ticks));
//this.SizeChanged += ProofreadMainControl_SizeChanged;
}
private void ProofreadMainControl_SizeChanged(object sender, EventArgs e)
{
//if(this.minWidth > 0 && this.Width < this.minWidth)
//{
// SendKeys.Send("{ESC}");
// this.Width = this.minWidth;
//}
}
public int LabelWidth()
{
return label1.Width;
}
public void ResetWeb()
{
if (!this.web.IsDisposed)
{
this.web.Stop();
this.web.Dispose();
}
}
}
}