38 lines
989 B
C#
38 lines
989 B
C#
using System;
|
|
using System.Windows.Forms;
|
|
using AIProofread.Controls;
|
|
using Office = Microsoft.Office.Core;
|
|
|
|
namespace AIProofread
|
|
{
|
|
public static class PanelModule
|
|
{
|
|
public static ProofreadMainControl uc;
|
|
public static Microsoft.Office.Tools.CustomTaskPane ctp;
|
|
|
|
/// <summary>
|
|
/// 显示panel
|
|
/// </summary>
|
|
public static void ShowProofreadPanel()
|
|
{
|
|
if (ctp == null)
|
|
{
|
|
uc = new ProofreadMainControl();
|
|
ctp = Globals.ThisAddIn.CustomTaskPanes.Add(control: uc, title: "AI校对王");
|
|
ctp.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
|
|
}
|
|
ctp.Visible = true;
|
|
}
|
|
public static void DisposeCTP()
|
|
{
|
|
if (ctp != null)
|
|
{
|
|
ctp.Dispose();
|
|
uc.Dispose();
|
|
ctp = null;
|
|
uc = null;
|
|
}
|
|
}
|
|
}
|
|
}
|