添加模块配置
This commit is contained in:
parent
d061406026
commit
b1ace782f8
Binary file not shown.
@ -386,6 +386,7 @@
|
|||||||
<Compile Include="Controls\ProofreadMainControl.Designer.cs">
|
<Compile Include="Controls\ProofreadMainControl.Designer.cs">
|
||||||
<DependentUpon>ProofreadMainControl.cs</DependentUpon>
|
<DependentUpon>ProofreadMainControl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="core\AppModule.cs" />
|
||||||
<Compile Include="core\BridgeResult.cs" />
|
<Compile Include="core\BridgeResult.cs" />
|
||||||
<Compile Include="core\CommonSenseDetection.cs" />
|
<Compile Include="core\CommonSenseDetection.cs" />
|
||||||
<Compile Include="core\CorrectionCharacter.cs" />
|
<Compile Include="core\CorrectionCharacter.cs" />
|
||||||
|
@ -56,9 +56,9 @@ namespace AIProofread
|
|||||||
public static bool RUN_IN_DEBUG = true;
|
public static bool RUN_IN_DEBUG = true;
|
||||||
public static AppEnvironment APP_ENV = AppEnvironment.Dev;
|
public static AppEnvironment APP_ENV = AppEnvironment.Dev;
|
||||||
#else
|
#else
|
||||||
public static string WEB_PATH = AppServer.PROD; // gm-plugin.gachafun.com pre-gm-plugin.gachafun.com
|
public static string WEB_PATH = AppServer.DEV; // gm-plugin.gachafun.com pre-gm-plugin.gachafun.com
|
||||||
public static bool RUN_IN_DEBUG = false;
|
public static bool RUN_IN_DEBUG = true;
|
||||||
public static AppEnvironment APP_ENV = AppEnvironment.Prod;
|
public static AppEnvironment APP_ENV = AppEnvironment.Dev;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public static readonly string APP_DATA_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ai_proofread";
|
public static readonly string APP_DATA_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ai_proofread";
|
||||||
|
13
AIProofread/Ribbon1.Designer.cs
generated
13
AIProofread/Ribbon1.Designer.cs
generated
@ -41,7 +41,6 @@ namespace AIProofread
|
|||||||
Microsoft.Office.Tools.Ribbon.RibbonDropDownItem ribbonDropDownItemImpl3 = this.Factory.CreateRibbonDropDownItem();
|
Microsoft.Office.Tools.Ribbon.RibbonDropDownItem ribbonDropDownItemImpl3 = this.Factory.CreateRibbonDropDownItem();
|
||||||
this.tabAIProofread = this.Factory.CreateRibbonTab();
|
this.tabAIProofread = this.Factory.CreateRibbonTab();
|
||||||
this.group1 = this.Factory.CreateRibbonGroup();
|
this.group1 = this.Factory.CreateRibbonGroup();
|
||||||
this.BtnProofreadAll = this.Factory.CreateRibbonButton();
|
|
||||||
this.menuProofreadList = this.Factory.CreateRibbonMenu();
|
this.menuProofreadList = this.Factory.CreateRibbonMenu();
|
||||||
this.BtnProofreadExact = this.Factory.CreateRibbonButton();
|
this.BtnProofreadExact = this.Factory.CreateRibbonButton();
|
||||||
this.BtnProofreadFull = this.Factory.CreateRibbonButton();
|
this.BtnProofreadFull = this.Factory.CreateRibbonButton();
|
||||||
@ -97,7 +96,6 @@ namespace AIProofread
|
|||||||
//
|
//
|
||||||
// group1
|
// group1
|
||||||
//
|
//
|
||||||
this.group1.Items.Add(this.BtnProofreadAll);
|
|
||||||
this.group1.Items.Add(this.menuProofreadList);
|
this.group1.Items.Add(this.menuProofreadList);
|
||||||
this.group1.Items.Add(this.BtnExportProofreadResult);
|
this.group1.Items.Add(this.BtnExportProofreadResult);
|
||||||
this.group1.Items.Add(this.btnClear);
|
this.group1.Items.Add(this.btnClear);
|
||||||
@ -106,16 +104,6 @@ namespace AIProofread
|
|||||||
this.group1.Items.Add(this.btnSetting);
|
this.group1.Items.Add(this.btnSetting);
|
||||||
this.group1.Name = "group1";
|
this.group1.Name = "group1";
|
||||||
//
|
//
|
||||||
// BtnProofreadAll
|
|
||||||
//
|
|
||||||
this.BtnProofreadAll.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
|
||||||
this.BtnProofreadAll.Image = global::AIProofread.Properties.Resources.icon_proofread;
|
|
||||||
this.BtnProofreadAll.Label = "全文校对\r\n";
|
|
||||||
this.BtnProofreadAll.Name = "BtnProofreadAll";
|
|
||||||
this.BtnProofreadAll.ShowImage = true;
|
|
||||||
this.BtnProofreadAll.Visible = false;
|
|
||||||
this.BtnProofreadAll.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnProofreadAll_Click);
|
|
||||||
//
|
|
||||||
// menuProofreadList
|
// menuProofreadList
|
||||||
//
|
//
|
||||||
this.menuProofreadList.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
this.menuProofreadList.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
|
||||||
@ -421,7 +409,6 @@ namespace AIProofread
|
|||||||
internal Microsoft.Office.Tools.Ribbon.RibbonLabel LblNickname;
|
internal Microsoft.Office.Tools.Ribbon.RibbonLabel LblNickname;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonLabel LblDate;
|
internal Microsoft.Office.Tools.Ribbon.RibbonLabel LblDate;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnLogin;
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnLogin;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnProofreadAll;
|
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnClear;
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnClear;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnOpenLexicon;
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnOpenLexicon;
|
||||||
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnSetting;
|
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnSetting;
|
||||||
|
@ -24,20 +24,29 @@ namespace AIProofread
|
|||||||
{
|
{
|
||||||
//btnLogin.Label = "用户\n登录";
|
//btnLogin.Label = "用户\n登录";
|
||||||
//btnLogout.Label = "退出\n登录";
|
//btnLogout.Label = "退出\n登录";
|
||||||
|
|
||||||
Globals.ThisAddIn.ribbon = this;
|
Globals.ThisAddIn.ribbon = this;
|
||||||
ShowDebug();
|
|
||||||
|
InitModule();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用于调试或测试
|
/// 用于调试或测试
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ShowDebug()
|
public void InitModule()
|
||||||
{
|
{
|
||||||
if (Config.RUN_IN_DEBUG)
|
menuProofreadList.Visible = AppModule.ENABLE_PROOFREAD;
|
||||||
{
|
BtnExportProofreadResult.Visible = AppModule.ENABLE_EXPORT_PROOFREAD_RESULT;
|
||||||
grpDebug.Visible = true;
|
btnOpenLexicon.Visible = AppModule.ENABLE_LEXICON_MANAGE;
|
||||||
}
|
menuSencenDect.Visible = AppModule.ENABLE_COMMONSENSE_CHECK;
|
||||||
|
btnSetting.Visible = AppModule.ENABLE_SETTING;
|
||||||
|
ButtonSaveCache.Visible = AppModule.ENABLE_SAVE_CACHE;
|
||||||
|
ButtonLoadCache.Visible = AppModule.ENABLE_LOAD_CACHE;
|
||||||
|
BtnGetContact.Visible = AppModule.ENABLE_CUSTOMER_SERVICE;
|
||||||
|
BtnUpdate.Visible = AppModule.ENABLE_UPGRADE;
|
||||||
|
BtnShowManual.Visible = AppModule.ENABLE_HELP;
|
||||||
|
|
||||||
|
// 调试面板
|
||||||
|
grpDebug.Visible = Config.RUN_IN_DEBUG;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCommonBtnStatus(bool status)
|
public void SetCommonBtnStatus(bool status)
|
||||||
@ -80,8 +89,6 @@ namespace AIProofread
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void InitWPS()
|
public void InitWPS()
|
||||||
{
|
{
|
||||||
|
|
||||||
BtnProofreadAll.Image = AIProofread.Properties.Resources.icon_proofread_wps;
|
|
||||||
menuProofreadList.Image = AIProofread.Properties.Resources.icon_proofread_wps;
|
menuProofreadList.Image = AIProofread.Properties.Resources.icon_proofread_wps;
|
||||||
btnClear.Image = AIProofread.Properties.Resources.icon_clear_wps;
|
btnClear.Image = AIProofread.Properties.Resources.icon_clear_wps;
|
||||||
btnOpenLexicon.Image = AIProofread.Properties.Resources.icon_book_wps;
|
btnOpenLexicon.Image = AIProofread.Properties.Resources.icon_book_wps;
|
||||||
@ -199,12 +206,6 @@ namespace AIProofread
|
|||||||
Bridge.bridge.ShowUpgradeView();
|
Bridge.bridge.ShowUpgradeView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnProofreadAll_Click(object sender, RibbonControlEventArgs e)
|
|
||||||
{
|
|
||||||
string time = DateTime.Now.ToString("yyyy - MM - dd HH: mm:ss: fff:ffffff");
|
|
||||||
Globals.ThisAddIn.SendMessageToWeb("start", time);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnClear_Click(object sender, RibbonControlEventArgs e)
|
private void btnClear_Click(object sender, RibbonControlEventArgs e)
|
||||||
{
|
{
|
||||||
//DocumentUtil.ClearProofreadMarks();
|
//DocumentUtil.ClearProofreadMarks();
|
||||||
|
@ -123,9 +123,6 @@
|
|||||||
<metadata name="group1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="group1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="BtnProofreadAll.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="menuProofreadList.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="menuProofreadList.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
@ -340,10 +340,10 @@ namespace AIProofread
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
Config.RUN_IN_DEBUG = config.AppRunInDebug;
|
Config.RUN_IN_DEBUG = config.AppRunInDebug;
|
||||||
if (Config.APP_ENV != AppEnvironment.Prod && this.ribbon != null)
|
//if (Config.APP_ENV != AppEnvironment.Prod && this.ribbon != null)
|
||||||
{
|
//{
|
||||||
this.ribbon.ShowDebug();
|
// this.ribbon.Ini();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
|
42
AIProofread/core/AppModule.cs
Normal file
42
AIProofread/core/AppModule.cs
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
namespace AIProofread.core
|
||||||
|
{
|
||||||
|
public class AppModule
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用导出校对结果
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_EXPORT_PROOFREAD_RESULT = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否词库管理
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_LEXICON_MANAGE = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用常识性检测
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_COMMONSENSE_CHECK = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 设置功能
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_SETTING = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否校对功能
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_PROOFREAD = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 优先查全
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_PROOFREAD_FULL = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 优先查准exact
|
||||||
|
/// </summary>
|
||||||
|
public const bool ENABLE_PROOFREAD_EXACT = true;
|
||||||
|
|
||||||
|
public const bool ENABLE_SAVE_CACHE = true;
|
||||||
|
public const bool ENABLE_LOAD_CACHE = true;
|
||||||
|
public const bool ENABLE_CUSTOMER_SERVICE = true;
|
||||||
|
public const bool ENABLE_UPGRADE = true;
|
||||||
|
public const bool ENABLE_HELP = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user