diff --git a/.vs/AIProofread/v17/.suo b/.vs/AIProofread/v17/.suo index 0c1a964..2c72990 100644 Binary files a/.vs/AIProofread/v17/.suo and b/.vs/AIProofread/v17/.suo differ diff --git a/AIProofread/Bridge.cs b/AIProofread/Bridge.cs index ac9fd43..de652fd 100644 --- a/AIProofread/Bridge.cs +++ b/AIProofread/Bridge.cs @@ -318,6 +318,11 @@ namespace AIProofread Globals.ThisAddIn.ShowLoginForm(action); } + public void MoveCursor(int pos) { + var rng = Globals.ThisAddIn.Application.ActiveDocument.Range(pos, pos); + rng.Select(); + } + public void SelectMarkById(int proofreadId) { if (proofreadId == selectProofreadId) return; @@ -331,6 +336,7 @@ namespace AIProofread { Globals.ThisAddIn.SendMessageToWeb("select", proofreadId); marks[proofreadId].Select(); + var doc = Globals.ThisAddIn.Application.ActiveDocument; } Globals.ThisAddIn.SendMessageToWeb("select_proofread", proofreadId); } diff --git a/AIProofread/ProofreadItem.cs b/AIProofread/ProofreadItem.cs index caa81b1..6bed46a 100644 --- a/AIProofread/ProofreadItem.cs +++ b/AIProofread/ProofreadItem.cs @@ -66,9 +66,16 @@ namespace UtilLib public void Select() { if (mark == null) return; + if(content.tag == "i") + { + var endPos = mark.Range.End; + var rng = Globals.ThisAddIn.Application.ActiveDocument.Range(endPos, endPos); + rng.Select(); + return; + } mark.Range.Font.Size = originSize + 2; // 将选中标签文本放大字体 mark.Select(); - + } public void UnSelect() { diff --git a/AIProofread/Ribbon1.Designer.cs b/AIProofread/Ribbon1.Designer.cs index 03edd2b..e8346d8 100644 --- a/AIProofread/Ribbon1.Designer.cs +++ b/AIProofread/Ribbon1.Designer.cs @@ -36,39 +36,24 @@ { this.tabAIProofread = this.Factory.CreateRibbonTab(); this.group1 = this.Factory.CreateRibbonGroup(); - this.BtnProofreadAll = this.Factory.CreateRibbonButton(); - this.btnClear = this.Factory.CreateRibbonButton(); - this.group3 = this.Factory.CreateRibbonGroup(); - this.btnOpenLexicon = this.Factory.CreateRibbonButton(); - this.group2 = this.Factory.CreateRibbonGroup(); - this.btnSetting = this.Factory.CreateRibbonButton(); - this.group4 = this.Factory.CreateRibbonGroup(); - this.BtnGetContact = this.Factory.CreateRibbonButton(); - this.BtnUpdate = this.Factory.CreateRibbonButton(); - this.gpLogin = this.Factory.CreateRibbonGroup(); - this.btnLogin = this.Factory.CreateRibbonButton(); - this.gpLogout = this.Factory.CreateRibbonGroup(); - this.btnLogout = this.Factory.CreateRibbonButton(); this.LblNickname = this.Factory.CreateRibbonLabel(); this.LblPhone = this.Factory.CreateRibbonLabel(); this.LblVersion = this.Factory.CreateRibbonLabel(); + this.BtnProofreadAll = this.Factory.CreateRibbonButton(); + this.btnClear = this.Factory.CreateRibbonButton(); + this.btnOpenLexicon = this.Factory.CreateRibbonButton(); + this.btnSetting = this.Factory.CreateRibbonButton(); + this.BtnGetContact = this.Factory.CreateRibbonButton(); + this.BtnUpdate = this.Factory.CreateRibbonButton(); + this.btnLogin = this.Factory.CreateRibbonButton(); + this.btnLogout = this.Factory.CreateRibbonButton(); this.tabAIProofread.SuspendLayout(); this.group1.SuspendLayout(); - this.group3.SuspendLayout(); - this.group2.SuspendLayout(); - this.group4.SuspendLayout(); - this.gpLogin.SuspendLayout(); - this.gpLogout.SuspendLayout(); this.SuspendLayout(); // // tabAIProofread // this.tabAIProofread.Groups.Add(this.group1); - this.tabAIProofread.Groups.Add(this.group3); - this.tabAIProofread.Groups.Add(this.group2); - this.tabAIProofread.Groups.Add(this.group4); - this.tabAIProofread.Groups.Add(this.gpLogin); - this.tabAIProofread.Groups.Add(this.gpLogout); this.tabAIProofread.Label = "AI校对王"; this.tabAIProofread.Name = "tabAIProofread"; this.tabAIProofread.Position = this.Factory.RibbonPosition.AfterOfficeId("TabHelp"); @@ -77,8 +62,32 @@ // this.group1.Items.Add(this.BtnProofreadAll); 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.LblPhone); + this.group1.Items.Add(this.LblVersion); this.group1.Name = "group1"; // + // LblNickname + // + this.LblNickname.Label = "张三 已登录"; + this.LblNickname.Name = "LblNickname"; + // + // LblPhone + // + this.LblPhone.Label = "188****8888"; + this.LblPhone.Name = "LblPhone"; + // + // LblVersion + // + this.LblVersion.Label = "企业内测版"; + this.LblVersion.Name = "LblVersion"; + // // BtnProofreadAll // this.BtnProofreadAll.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; @@ -97,11 +106,6 @@ this.btnClear.ShowImage = true; this.btnClear.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnClear_Click); // - // group3 - // - this.group3.Items.Add(this.btnOpenLexicon); - this.group3.Name = "group3"; - // // btnOpenLexicon // this.btnOpenLexicon.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; @@ -111,11 +115,6 @@ this.btnOpenLexicon.ShowImage = true; this.btnOpenLexicon.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnOpenLexicon_Click); // - // group2 - // - this.group2.Items.Add(this.btnSetting); - this.group2.Name = "group2"; - // // btnSetting // this.btnSetting.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; @@ -125,12 +124,6 @@ this.btnSetting.ShowImage = true; this.btnSetting.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnSetting_Click); // - // group4 - // - this.group4.Items.Add(this.BtnGetContact); - this.group4.Items.Add(this.BtnUpdate); - this.group4.Name = "group4"; - // // BtnGetContact // this.BtnGetContact.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; @@ -149,11 +142,6 @@ this.BtnUpdate.ShowImage = true; this.BtnUpdate.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnUpdate_Click); // - // gpLogin - // - this.gpLogin.Items.Add(this.btnLogin); - this.gpLogin.Name = "gpLogin"; - // // btnLogin // this.btnLogin.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; @@ -163,15 +151,6 @@ this.btnLogin.ShowImage = true; this.btnLogin.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnLogin_Click); // - // gpLogout - // - this.gpLogout.Items.Add(this.btnLogout); - this.gpLogout.Items.Add(this.LblNickname); - this.gpLogout.Items.Add(this.LblPhone); - this.gpLogout.Items.Add(this.LblVersion); - this.gpLogout.Name = "gpLogout"; - this.gpLogout.Visible = false; - // // btnLogout // this.btnLogout.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; @@ -181,21 +160,6 @@ this.btnLogout.ShowImage = true; this.btnLogout.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnLogout_Click); // - // LblNickname - // - this.LblNickname.Label = "张三 已登录"; - this.LblNickname.Name = "LblNickname"; - // - // LblPhone - // - this.LblPhone.Label = "188****8888"; - this.LblPhone.Name = "LblPhone"; - // - // LblVersion - // - this.LblVersion.Label = "企业内测版"; - this.LblVersion.Name = "LblVersion"; - // // Ribbon1 // this.Name = "Ribbon1"; @@ -206,16 +170,6 @@ this.tabAIProofread.PerformLayout(); this.group1.ResumeLayout(false); this.group1.PerformLayout(); - this.group3.ResumeLayout(false); - this.group3.PerformLayout(); - this.group2.ResumeLayout(false); - this.group2.PerformLayout(); - this.group4.ResumeLayout(false); - this.group4.PerformLayout(); - this.gpLogin.ResumeLayout(false); - this.gpLogin.PerformLayout(); - this.gpLogout.ResumeLayout(false); - this.gpLogout.PerformLayout(); this.ResumeLayout(false); } @@ -224,8 +178,6 @@ internal Microsoft.Office.Tools.Ribbon.RibbonTab tabAIProofread; internal Microsoft.Office.Tools.Ribbon.RibbonGroup group1; - internal Microsoft.Office.Tools.Ribbon.RibbonGroup gpLogin; - internal Microsoft.Office.Tools.Ribbon.RibbonGroup gpLogout; internal Microsoft.Office.Tools.Ribbon.RibbonButton btnLogout; internal Microsoft.Office.Tools.Ribbon.RibbonLabel LblNickname; internal Microsoft.Office.Tools.Ribbon.RibbonLabel LblPhone; @@ -233,11 +185,8 @@ 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.RibbonGroup group3; internal Microsoft.Office.Tools.Ribbon.RibbonButton btnOpenLexicon; - internal Microsoft.Office.Tools.Ribbon.RibbonGroup group2; internal Microsoft.Office.Tools.Ribbon.RibbonButton btnSetting; - internal Microsoft.Office.Tools.Ribbon.RibbonGroup group4; internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnGetContact; internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnUpdate; } diff --git a/AIProofread/Ribbon1.cs b/AIProofread/Ribbon1.cs index 67777e0..7d25f63 100644 --- a/AIProofread/Ribbon1.cs +++ b/AIProofread/Ribbon1.cs @@ -46,8 +46,13 @@ namespace AIProofread // 处理是否登录的展示 private void ToggleLogin() { - gpLogin.Visible = !IS_LOGIN; - gpLogout.Visible = IS_LOGIN; + + btnLogin.Visible = !IS_LOGIN; + + btnLogout.Visible = IS_LOGIN; + LblNickname.Visible = IS_LOGIN; + LblPhone.Visible = IS_LOGIN; + LblVersion.Visible = IS_LOGIN; } // 弹出登录窗口 diff --git a/AIProofread/ThisAddIn.cs b/AIProofread/ThisAddIn.cs index fb225da..56f54c2 100644 --- a/AIProofread/ThisAddIn.cs +++ b/AIProofread/ThisAddIn.cs @@ -18,7 +18,7 @@ namespace AIProofread public static SynchronizationContext FmainThreadContext; - public string AddinName = "AI校对王"; + public string AddinName = Config.APP_NAME; /// /// 最小宽度 /// diff --git a/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache b/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache index 34d6b8c..32241e4 100644 Binary files a/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache and b/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache differ diff --git a/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache b/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache index 70129a1..165e210 100644 Binary files a/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache and b/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache differ diff --git a/AIProofread/obj/Debug/AIProofread.dll b/AIProofread/obj/Debug/AIProofread.dll index 699dbc8..1b72568 100644 Binary files a/AIProofread/obj/Debug/AIProofread.dll and b/AIProofread/obj/Debug/AIProofread.dll differ diff --git a/AIProofread/obj/Debug/AIProofread.pdb b/AIProofread/obj/Debug/AIProofread.pdb index 1e034dd..3e71793 100644 Binary files a/AIProofread/obj/Debug/AIProofread.pdb and b/AIProofread/obj/Debug/AIProofread.pdb differ diff --git a/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 1dddad4..1a3557b 100644 Binary files a/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ